Hello. I've recently picked up on Zelda Classic programming. I've been coding in Java (relevance) for the last couple years. Since I really enjoy coding and Zelda Classic, I thought I'd combine the two and test myself. However, I'm an extreme novice in the Zelda Classic (zscript) library and I really need help learning this. But in this case, I need help with this script.
If anyone can help me with this matter, please show me what to do and explain why mine isn't working. Thanks!
Basically, after every second which has passed after the poison sword makes contact with the mob, I want it to receive a quarter heart of damage for 3 seconds. Problem is: the enemy won't take constant damage after contact has been made.
Basically, after every second which has passed after the poison sword makes contact with the mob, I want it to receive a quarter heart of damage for 3 seconds. Problem is: the enemy won't take constant damage after contact has been made. If anyone can help me with this matter, please show me what to do and explain why mine isn't working.
import "std.zh" item script PoisonSword { void run() { lweapon sword; npc n; int PoisonEffectTime = 3; int time = 0; for (int w = Screen->NumNPCs(); w<=0; w++) { n = Screen->LoadNPC(w); if (Collision(sword,n)) { while (time < PoisonEffectTime) { Waitframe(); n->HP = 0; time++; } } } } }