Cancel an attack/skill in Developer Help
|
|
punch format = "$'punch', $'p'; $anything; ~$mob(oview, user, 0)" Process(mob/user, T, mob/M) var/dmgreduc = 25 - M.DamageReduction var/damage = round((dmgreduc/100)*user.PowerLevel)
user.CheckInView(M)
if(M.Unconcious == 1) user << "You can't attack someone who is unconcious you must finish them!" return
if(T == "right" || T == "r") user.InAction = 1 user.inFight = 1 user.fighting += M user.Energy -= 3 M.inFight = 1 M.fighting += user user << "<font color=blue><b>You retract your right arm...</b></font>" user.inview << "[user.name] retracts their right arm..." M << "<font color=red><b>[user.name] retracts their right arm...</b></font> [M.CheckPowerTips(M.MaxPowerLevel, 1)]" user.Attack(user, M, damage, 1)
|
proc
mob proc Attack(mob/user, mob/M, damage, attacktype) if(attacktype == 1) while(user.InAction == 1) spawn(25 - user.Speed) M.PowerLevel -= damage M.Energy -= 3 user << "[damage]" M << 2 user.inview << 3 user.InAction = 0 M.CheckPower() break
|
Problem description:
Trying to figure a good way to cancel an attack to make a attack faking system say you start an attack and it takes a moment to take effect but then you do the same attack again you want the last one to cancel out and the new one proceed.
|