home *** CD-ROM | disk | FTP | other *** search
/ Classic Fond 52 / ClassicFond52.iso / GAMES / DROIDW.RAR / DWCD.GOB / mission_cog_00_damagewall.cog < prev    next >
Encoding:
Text File  |  1998-11-04  |  1.0 KB  |  43 lines

  1. # Jedi Knight Cog Script
  2. #
  3. # 00_damagewall.cog
  4. #
  5. # inflicts damage when player touches a surface (can be used on nomove adjoins)
  6. # damage amount is random between minDamage and maxDamage
  7. #
  8. # [IS]
  9. #
  10. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  11. # ========================================================================================
  12.  
  13. symbols
  14. message        touched
  15.  
  16. surface        surf0        mask=0x40d
  17. surface        surf1        mask=0x40d
  18. surface        surf2        mask=0x40d    
  19. surface        surf3        mask=0x40d
  20. surface        surf4        mask=0x40d
  21. surface        surf5        mask=0x40d
  22. surface        surf6        mask=0x40d
  23. surface        surf7        mask=0x40d
  24.  
  25. flex        maxDamage=10.0
  26. flex        minDamage=5.0
  27.  
  28. int        victim=-1    local
  29. flex        damage=0    local
  30. flex        garbage=0    local
  31. end
  32.  
  33. # ========================================================================================
  34.  
  35. code
  36. touched:
  37.     victim = GetSourceRef();
  38.     damage = (rand() * (maxDamage - minDamage)) + minDamage;
  39.     garbage = DamageThing(victim, damage, 0x2, victim);        // self-inflicted damage
  40.     return;
  41. end
  42.  
  43.