ID:160432
 
Ok I wont put all code in just this bit.

mob
var/life = 9999

verb
Attack(mob/Victim in oview(1))
var/damage = (2200)
life -= damage

Is it possible to put an if statement so it will deal 2200 damage if the icon state is 'Shadow.dmi'? I've tried yet failed. Thanks in advance.
Gyroz wrote:
Ok I wont put all code in just this bit.

mob
var/life = 9999

verb
Attack(mob/Victim in oview(1))
var/damage = (2200)
life -= damage

Is it possible to put an if statement so it will deal 2200 damage if the icon state is 'Shadow.dmi'? I've tried yet failed. Thanks in advance.

The answer to your problem lies in the question =P

var/damage = 1000
if(src.icon == 'Shadow.dmi') damage = 2200


Also, for purposes of clarification, an icon is a graphic such as a DMI, PNG, or BMP, and is denoted with apostrophes, E.G. 'myicon.dmi'. The icon_state is a specific segment of the file and is contained in quotes, such as "monster".
In response to Mobius Evalon (#1)
Thanks for trying, maybe it was how I put my words together that led you astray.

The if wanted though is if a Icon_state under an icon can fit into this if statement.

so except from,

if (src.icon == 'Shadow.dmi') damage = 2200

is it possible at all for a change in damage depending on an icon state under an icon.

Thanks in advance.

Edit: This is Gyroz under another key.
In response to Saintzy (#2)
Nevermind i've found out the problem, thankyou for helping Mobius.