+ 1

A good Teamplayer

https://code.sololearn.com/cgCzMrRmnc13/?ref=app Do sombody know how the „Witch“ not just heal herself???

9th Feb 2019, 8:41 AM
David the Kangoro
David the Kangoro - avatar
6 Answers
+ 6
if (player is Witch){ ((Witch)player).Heal(player); } Since player is Witch and Witch heals player, Witch heals itself! You might need to add a step before healing, like: if (player is Witch){ // random_p = (select random) ((Witch)player).Heal(random_p); }
9th Feb 2019, 9:33 AM
Hatsy Rei
Hatsy Rei - avatar
+ 7
Btw, I made something really similar to your code way back. It was a lot of fun! https://code.sololearn.com/cgNuU15zVpos/?ref=app
9th Feb 2019, 9:34 AM
Hatsy Rei
Hatsy Rei - avatar
+ 4
David the Kangoro Seeing your problem was already resolved it would be great if you can mark the answer that you find useful to encourage the community to help each other out. 😉
9th Feb 2019, 10:23 AM
Zephyr Koo
Zephyr Koo - avatar
+ 1
Thank you very much, Hatsi Rei !!! 😋😋
9th Feb 2019, 9:35 AM
David the Kangoro
David the Kangoro - avatar
+ 1
Your Code is very nice
9th Feb 2019, 9:36 AM
David the Kangoro
David the Kangoro - avatar
+ 1
I think im inspired now...😂 Thanks again!
9th Feb 2019, 9:37 AM
David the Kangoro
David the Kangoro - avatar