Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.97 KB | None | 0 0
  1. zombie_damage( mod, hit_location, hit_origin, player )
  2. {
  3. shock_ammo = maps\_blst_custom_ammo::blst_shock( self.damageweapon, mod );
  4. flame_ammo = maps\_blst_custom_ammo::blst_flame( self.damageweapon, mod );
  5. explosive_ammo = maps\_blst_custom_ammo::blst_explosive( self.damageweapon, mod, self );
  6.  
  7. if( is_magic_bullet_shield_enabled( self ) )
  8. {
  9. return;
  10. }
  11.  
  12. //ChrisP - 12/8 - no points for killing gassed zombies!
  13. player.use_weapon_type = mod;
  14. if(isDefined(self.marked_for_death))
  15. {
  16. return;
  17. }
  18.  
  19. if( !IsDefined( player ) )
  20. {
  21. return;
  22. }
  23.  
  24. if( shock_ammo )
  25. {
  26. shock_tag = maps\_blst_custom_ammo::hit_tag( hit_location );
  27. if( isdefined( shock_tag ) )
  28. {
  29. network_safe_play_fx_on_tag( "shock_impact_fx", 3, level._effect["blst_shock_ammo"], self, shock_tag );
  30. self playsound( "imp_tesla" );
  31. }
  32. }
  33.  
  34. if( flame_ammo )
  35. {
  36. if( !isdefined( self.flame_ammo_on_fire ) || isdefined( self.flame_ammo_on_fire ) && !self.flame_ammo_on_fire )
  37. {
  38. flame_tag = maps\_blst_custom_ammo::hit_tag( hit_location );
  39. if( isdefined(flame_tag))
  40. {
  41. network_safe_play_fx_on_tag( "flame_impact_fx", 3, level._effect["character_fire_pain_sm"], self, flame_tag );
  42. }
  43. self thread maps\_blst_custom_ammo::blst_flame_ammo( player );
  44. }
  45. }
  46.  
  47. if( explosive_ammo )
  48. {
  49. expl_tag = maps\_blst_custom_ammo::hit_tag( hit_location );
  50. if( isdefined( expl_tag))
  51. {
  52. network_safe_play_fx_on_tag( "expl_impact_fx", 3, level._effect["blst_expl_ammo"], self, expl_tag );
  53. }
  54. self maps\_blst_custom_ammo::blst_expl_ammo( hit_location );
  55. }
  56.  
  57.  
  58. if( self zombie_flame_damage( mod, player ) )
  59. {
  60. if( self zombie_give_flame_damage_points() )
  61. {
  62. player maps\_zombiemode_score::player_add_points( "damage", mod, hit_location, self enemy_is_dog() );
  63. }
  64. }
  65. else if( self maps\_zombiemode_tesla::is_tesla_damage( mod ) )
  66. {
  67. self maps\_zombiemode_tesla::tesla_damage_init( hit_location, hit_origin, player );
  68. return;
  69. }
  70. else
  71. {
  72. player maps\_zombiemode_score::player_add_points( "damage", mod, hit_location, self enemy_is_dog() );
  73. }
  74.  
  75. if ( mod == "MOD_GRENADE" || mod == "MOD_GRENADE_SPLASH" )
  76. {
  77. if ( isdefined( player ) && isalive( player ) )
  78. {
  79. self DoDamage( level.round_number + randomintrange( 100, 500 ), self.origin, player);
  80. }
  81. else
  82. {
  83. self DoDamage( level.round_number + randomintrange( 100, 500 ), self.origin, undefined );
  84. }
  85. }
  86. else if( mod == "MOD_PROJECTILE" || mod == "MOD_EXPLOSIVE" || mod == "MOD_PROJECTILE_SPLASH" || mod == "MOD_PROJECTILE_SPLASH")
  87. {
  88. if ( isdefined( player ) && isalive( player ) )
  89. {
  90. self DoDamage( level.round_number * randomintrange( 0, 100 ), self.origin, player);
  91. }
  92. else
  93. {
  94. self DoDamage( level.round_number * randomintrange( 0, 100 ), self.origin, undefined );
  95. }
  96. }
  97. else if( mod == "MOD_ZOMBIE_BETTY" )
  98. {
  99. if ( isdefined( player ) && isalive( player ) )
  100. {
  101. self DoDamage( level.round_number * randomintrange( 100, 200 ), self.origin, player);
  102. }
  103. else
  104. {
  105. self DoDamage( level.round_number * randomintrange( 100, 200 ), self.origin, undefined );
  106. }
  107. }
  108.  
  109. //AUDIO Plays a sound when Crawlers are created
  110. if( IsDefined( self.a.gib_ref ) && (self.a.gib_ref == "no_legs") && isalive( self ) )
  111. {
  112. if ( isdefined( player ) )
  113. {
  114. rand = randomintrange(0, 100);
  115. if(rand < 10)
  116. {
  117. index = maps\_zombiemode_weapons::get_player_index(player);
  118. plr = "plr_" + index + "_";
  119. player thread create_and_play_dialog( plr, "vox_crawl_spawn", 0.25, "resp_cspawn" );
  120. }
  121. }
  122. }
  123. else if( IsDefined( self.a.gib_ref ) && ( (self.a.gib_ref == "right_arm") || (self.a.gib_ref == "left_arm") ) )
  124. {
  125. if( self.has_legs && isalive( self ) )
  126. {
  127. if ( isdefined( player ) )
  128. {
  129. rand = randomintrange(0, 100);
  130. if(rand < 3)
  131. {
  132. index = maps\_zombiemode_weapons::get_player_index(player);
  133. plr = "plr_" + index + "_";
  134. player thread create_and_play_dialog( plr, "vox_shoot_limb", 0.25 );
  135. }
  136. }
  137. }
  138. }
  139. self thread maps\_zombiemode_powerups::check_for_instakill( player );
  140. }
  141.  
  142. zombie_damage_ads( mod, hit_location, hit_origin, player )
  143. {
  144. shock_ammo = maps\_blst_custom_ammo::blst_shock( self.damageweapon, mod );
  145. flame_ammo = maps\_blst_custom_ammo::blst_flame( self.damageweapon, mod );
  146. explosive_ammo = maps\_blst_custom_ammo::blst_explosive( self.damageweapon, mod, self );
  147. if( is_magic_bullet_shield_enabled( self ) )
  148. {
  149. return;
  150. }
  151.  
  152. player.use_weapon_type = mod;
  153. if( !IsDefined( player ) )
  154. {
  155. return;
  156. }
  157. if( shock_ammo )
  158. {
  159. shock_tag = maps\_blst_custom_ammo::hit_tag( hit_location );
  160. if( isdefined( shock_tag ) )
  161. {
  162. network_safe_play_fx_on_tag( "shock_impact_fx", 3, level._effect["blst_shock_ammo"], self, shock_tag );
  163. self playsound( "imp_tesla" );
  164. }
  165. }
  166.  
  167. if( flame_ammo )
  168. {
  169. if( !isdefined( self.flame_ammo_on_fire ) || isdefined( self.flame_ammo_on_fire ) && !self.flame_ammo_on_fire )
  170. {
  171. flame_tag = maps\_blst_custom_ammo::hit_tag( hit_location );
  172. if( isdefined(flame_tag))
  173. {
  174. network_safe_play_fx_on_tag( "flame_impact_fx", 3, level._effect["character_fire_pain_sm"], self, flame_tag );
  175. }
  176. self thread maps\_blst_custom_ammo::blst_flame_ammo( player );
  177. }
  178. }
  179.  
  180. if( explosive_ammo )
  181. {
  182. expl_tag = maps\_blst_custom_ammo::hit_tag( hit_location );
  183. if( isdefined( expl_tag))
  184. {
  185. network_safe_play_fx_on_tag( "expl_impact_fx", 3, level._effect["blst_expl_ammo"], self, expl_tag );
  186. }
  187. self maps\_blst_custom_ammo::blst_expl_ammo( hit_location );
  188. }
  189.  
  190.  
  191. if( self zombie_flame_damage( mod, player ) )
  192. {
  193. if( self zombie_give_flame_damage_points() )
  194. {
  195. player maps\_zombiemode_score::player_add_points( "damage_ads", mod, hit_location );
  196. }
  197. }
  198. else if( self maps\_zombiemode_tesla::is_tesla_damage( mod ) )
  199. {
  200. self maps\_zombiemode_tesla::tesla_damage_init( hit_location, hit_origin, player );
  201. return;
  202. }
  203. else
  204. {
  205. player maps\_zombiemode_score::player_add_points( "damage_ads", mod, hit_location );
  206. }
  207.  
  208. self thread maps\_zombiemode_powerups::check_for_instakill( player );
  209. }
  210.  
  211. zombie_give_flame_damage_points()
  212. {
  213. if( GetTime() > self.flame_damage_time )
  214. {
  215. self.flame_damage_time = GetTime() + level.zombie_vars["zombie_flame_dmg_point_delay"];
  216. return true;
  217. }
  218.  
  219. return false;
  220. }
  221.  
  222. zombie_flame_damage( mod, player )
  223. {
  224. if( mod == "MOD_BURNED" )
  225. {
  226. self.moveplaybackrate = 0.8;
  227.  
  228. if( !IsDefined( self.is_on_fire ) || ( Isdefined( self.is_on_fire ) && !self.is_on_fire ) )
  229. {
  230. self thread damage_on_fire( player );
  231. }
  232.  
  233. do_flame_death = true;
  234. dist = 100 * 100;
  235. ai = GetAiArray( "axis" );
  236. for( i = 0; i < ai.size; i++ )
  237. {
  238. if( IsDefined( ai[i].is_on_fire ) && ai[i].is_on_fire )
  239. {
  240. if( DistanceSquared( ai[i].origin, self.origin ) < dist )
  241. {
  242. do_flame_death = false;
  243. break;
  244. }
  245. }
  246. }
  247.  
  248. if( do_flame_death )
  249. {
  250. self thread animscripts\death::flame_death_fx();
  251. }
  252.  
  253. return true;
  254. }
  255.  
  256. return false;
  257. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement