Changing move-types with an attribute? Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Designing Games for Zillions » Changing move-types with an attribute? « Previous Next »

Author Message
Tony Britton (Captain)
New member
Username: Captain

Post Number: 17
Registered: 12-2009
Posted on Thursday, March 11, 2021 - 4:07 pm:   

Is it possible to change the move type of a piece when doing a
North
(while (on-board? e)
(if $1
(set-attribute $2 true)
change-owner
change-type
(set-attribute $1 false))e)

Will that change the move type from say this
(move-type whitetype)
(leap2 n ne Northern? eee)

to that

(move-type blacktype)
(leap2 n ne Northern? www) ?

Or is it possible that when you change that with (change-owner) that the symmetry of the piece changes also?
Shigeki Watanabe (Watanabe)
New member
Username: Watanabe

Post Number: 47
Registered: 3-2018
Posted on Thursday, March 18, 2021 - 2:33 am:   

> Is it possible to change a pieces move-type during the Or is it possible that when you change that with (change-owner) that the symmetry of the piece changes also?

The command of "change-owner" to a piece will be done after the move of a piece is complete.

So, the change of symmetry of a piece will be reflected from the next move.
Tony Britton (Captain)
New member
Username: Captain

Post Number: 19
Registered: 12-2009
Posted on Tuesday, March 23, 2021 - 7:33 pm:   

Thanks Watanabe,I sort of figured a way around the move-type problem and I installed your pin code and your vector movements.It works quite well, EXCEPT it wont allow pin pieces to capture its attacker as a way to change the dynamics of the pin. I've been trying to modify your code as to have a
(define pin2
(if (attacked? $1)
(while (empty? $2) $2)
(if (and (piece? Northern-King $2)
(friend? $2) )
(if (or (not-friend? $1)
(capture $3))
(or (set-flag pinned? true))) )
back
So the piece? has the option to capture it's attacker if possible or set-flag pinned? true. I have not had any luck so far but if have any idea as to a solution I am all eyes and ears/Thank You again for your help. I was trying to paste a snipe of the board to show you. but I am having no luck.

Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: