home *** CD-ROM | disk | FTP | other *** search
- # Jedi Knight Cog Script
- #
- # 00_damagewall.cog
- #
- # inflicts damage when player touches a surface (can be used on nomove adjoins)
- # damage amount is random between minDamage and maxDamage
- #
- # [IS]
- #
- # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
- # ========================================================================================
-
- symbols
- message touched
-
- surface surf0 mask=0x40d
- surface surf1 mask=0x40d
- surface surf2 mask=0x40d
- surface surf3 mask=0x40d
- surface surf4 mask=0x40d
- surface surf5 mask=0x40d
- surface surf6 mask=0x40d
- surface surf7 mask=0x40d
-
- flex maxDamage=10.0
- flex minDamage=5.0
-
- int victim=-1 local
- flex damage=0 local
- flex garbage=0 local
- end
-
- # ========================================================================================
-
- code
- touched:
- victim = GetSourceRef();
- damage = (rand() * (maxDamage - minDamage)) + minDamage;
- garbage = DamageThing(victim, damage, 0x2, victim); // self-inflicted damage
- return;
- end
-
-