/* * $Header: /H3/game/hcode/icemace.hc 95 9/25/97 4:06p Mgummelt $ */ /* ============================================================================== Q:\art\models\weapons\icestaff\final\icestaff.hc ============================================================================== */ // For building the model $cd Q:\art\models\weapons\icestaff\final $origin 10 -10 10 $base BASE skin $skin skin $skin skin2 $flags 0 // $frame fire1a fire1b fire1c $frame fire2a fire2b fire2c $frame fire3a fire3b fire3c $frame fire4a fire4b fire4c $frame fire5a fire5b fire5c // $frame idle1 idle2 idle3 idle4 idle5 $frame idle6 idle7 idle8 idle9 idle10 $frame idle11 idle12 idle13 idle14 idle15 $frame idle16 // $frame power1 power2 power3 power4 power5 $frame power6 power7 power8 power9 // $frame select1 select2 select3 select4 select5 $frame select6 select7 select8 select9 select10 void() IceCubeThink = { if(self.freeze_time144) { self.colormap-=1; self.abslight-=0.05; } else { self.colormap=0; self.abslight=0.5; self.skin=GLOBAL_SKIN_ICE; } if(random()<0.2&&random()<0.2) sound(self,CHAN_AUTO,"misc/drip.wav",1,ATTN_NORM); self.think=IceCubeThink; thinktime self : 0.1; }; void (entity loser,entity forwhom) SnowJob= { //FIXME: Make gradual- person slows down then stops entity oself; if(loser.solid==SOLID_BSP) return; if(coop) if(loser.classname=="player"&&forwhom.classname=="player") return; if(teamplay) if(loser.team==forwhom.team) return; if(loser.flags&FL_MONSTER&&loser.monsterclass>=CLASS_BOSS) { T_Damage(loser,self,forwhom,10); return; } sound(loser,CHAN_BODY,"crusader/frozen.wav",1,ATTN_NORM); loser.frozen=50; loser.oldskin=loser.skin; if(loser.classname!="player") { loser.colormap=159; loser.thingtype=THINGTYPE_ICE; loser.freeze_time=time+5; if(loser.scale==0) loser.scale = 1; loser.lifetime=loser.scale; loser.o_angle=loser.mins; loser.v_angle=loser.maxs; loser.enemy=forwhom; loser.oldthink=loser.think; loser.think=IceCubeThink; thinktime loser : 0; loser.touch=SUB_Null; loser.th_pain=SUB_Null; loser.wait = time + 3; if(loser.angles_x==0&&loser.angles_z==0) loser.drawflags(+)SCALE_ORIGIN_BOTTOM; loser.oldmovetype=loser.movetype; loser.movetype=MOVETYPE_TOSS; loser.health=1; loser.deathtype="ice melt"; loser.th_die=shatter; AwardExperience(forwhom,loser,loser.experience_value); loser.experience_value=0; oself=self; self=loser; SUB_UseTargets(); self=oself; } else { loser.artifact_active(+)ARTFLAG_FROZEN; loser.colormap=159; loser.thingtype=THINGTYPE_ICE; loser.o_angle=loser.v_angle; loser.pausetime = time + 10; loser.attack_finished = time + 10; //Temp -turns screen blue loser.health=1; thinktime loser : 10; //Prevent interruption? loser.th_pain=SUB_Null; } loser.flags(-)FL_FLY; loser.flags(-)FL_SWIM; if(loser.flags&FL_ONGROUND) loser.last_onground=time; loser.flags(-)FL_ONGROUND; //need to be able to reverse this... loser.oldtouch=loser.touch; loser.touch=obj_push; loser.drawflags(+)DRF_TRANSLUCENT|MLS_ABSLIGHT; loser.abslight=1; }; void FreezeDie() { particleexplosion(self.origin,14,10,10); particle2(self.origin,'-10 -10 -10','10 10 10',145,14,5); if(self.movechain!=world) remove(self.movechain); remove(self); } void remove_artflag () { if(self.enemy.frozen<=0) self.enemy.artifact_active(-)self.artifact_active; remove(self); } void() FreezeTouch= { if(other==self.owner) return; starteffect(CE_ICE_HIT,self.origin-self.movedir*8); if(other.takedamage&&other.health&&other.frozen<=0&&other.thingtype==THINGTYPE_FLESH)//FIXME: Thingtype_flesh only { sound (self, CHAN_BODY, "crusader/icehit.wav", 1, ATTN_NORM); if(other.frozen<=0) { if(other.freeze_time<=time) other.frozen=0; other.freeze_time=time+2.5; other.frozen-=1; if(other.classname=="player") { other.artifact_active(+)ARTFLAG_FROZEN; newmis=spawn(); newmis.enemy=other; newmis.artifact_active=ARTFLAG_FROZEN; newmis.think=remove_artflag; thinktime newmis : 0.1; } } if(other.flags&FL_COLDHEAL)//Had to take out cold heal, so cold resist T_Damage(other,self,self.owner,3); else if((other.health<=10||(other.classname=="player"&&other.frozen<=-5&&other.health<200))&&other.solid!=SOLID_BSP&&!other.artifact_active&ART_INVINCIBILITY&&other.thingtype==THINGTYPE_FLESH&&other.health<100) SnowJob(other,self.owner); else T_Damage(other,self,self.owner,10); self.think=FreezeDie; thinktime self : 0; } else if(other.frozen<=0) { sound (self, CHAN_BODY, "crusader/icewall.wav", 1, ATTN_NORM); T_RadiusDamage(self,self.owner,30,self.owner); self.touch=SUB_Null; shatter(); } else sound(self,CHAN_BODY,"misc/tink.wav",1,ATTN_NORM); }; void()FireFreeze= { //vector dir; self.bluemana-=1; self.attack_finished=time + 0.05; self.punchangle_x= -1; makevectors (self.v_angle); sound (self, CHAN_WEAPON, "crusader/icefire.wav", 1, ATTN_NORM); newmis = spawn (); newmis.owner = self; newmis.movetype = MOVETYPE_BOUNCEMISSILE; newmis.solid = SOLID_BBOX; newmis.th_die=shatter; newmis.deathtype="ice shatter"; newmis.touch = FreezeTouch; newmis.classname = "snowball"; newmis.speed = 1200; newmis.movedir=normalize(v_forward); newmis.velocity = newmis.movedir * newmis.speed; newmis.angles = vectoangles(newmis.velocity); newmis.avelocity=randomv('-600 -600 -600','600 600 600'); setmodel (newmis, "models/iceshot1.mdl"); newmis.drawflags=MLS_ABSLIGHT; newmis.abslight=0.5; setsize (newmis, '0 0 0', '0 0 0'); setorigin (newmis, self.origin+self.proj_ofs + v_forward*8); entity corona; corona=spawn(); newmis.movechain=corona; corona.movetype=MOVETYPE_NOCLIP; corona.avelocity=randomv('-600 -600 -600','600 600 600'); corona.drawflags=DRF_TRANSLUCENT|MLS_ABSLIGHT; corona.abslight=0.5; corona.scale=2; corona.think=SUB_Remove; thinktime corona : 2; setmodel(corona,"models/iceshot2.mdl"); setsize(corona,'0 0 0','0 0 0'); setorigin(corona,newmis.origin); }; void shard_hit (void) { if(other.classname=="blizzard shard") return; if(other.takedamage&&other.health&&other!=self.owner) T_Damage(other,self,self.owner,50*self.scale); sound(self,CHAN_AUTO,"crusader/icewall.wav",0.1,ATTN_NORM); particleexplosion(self.origin,14,20,5); // particle2(self.origin,'-10 -10 -10','10 10 10',145,14,5); remove(self); } void FireShard (void) { local vector org,dir; newmis=spawn(); newmis.movetype=MOVETYPE_BOUNCE; newmis.solid=SOLID_TRIGGER; newmis.owner=self.owner; dir_x=random(50,100); dir_y=random(50,100); dir_z=random(-250,-180); org_x= random(-84,-8); org_y= random(-84,-8); if(org_x<64) org_z=64+org_x; else if(org_y<64) org_z=64+org_y; org_x+=self.origin_x; org_y+=self.origin_y; org_z+=self.origin_z+64; traceline(self.origin,org,TRUE,self); org=trace_endpos; newmis.velocity=dir; newmis.angles=vectoangles(newmis.velocity)+'90 0 0'; newmis.scale=random(0.05,0.55); newmis.skin=0; newmis.frame=0; newmis.touch=shard_hit; setmodel(newmis,"models/shard.mdl"); setsize(newmis,'0 0 0','0 0 0'); setorigin(newmis,org); } void() blizzard_think= { entity loser; vector dir, top, bottom, beam_angle; float beam_count; if(self.lifetime=10) icestaff_blizzard(); else if(!self.artifact_active&ART_TOMEOFPOWER&&self.bluemana>=1) FireFreeze(); else icestaff_idle(); } void icestaff_f2 (void) { self.th_weapon=icestaff_f2; self.wfs = advanceweaponframe($fire2a,$fire2c); if (self.wfs==WF_CYCLE_WRAPPED) if(!self.button0) icestaff_idle(); else icestaff_shard(); else if (self.attack_finished<=time&&self.weaponframe==$fire2a) if(self.artifact_active&ART_TOMEOFPOWER&&self.bluemana>=10) icestaff_blizzard(); else if(!self.artifact_active&ART_TOMEOFPOWER&&self.bluemana>=1) FireFreeze(); else icestaff_idle(); } void icestaff_f3 (void) { self.th_weapon=icestaff_f3; self.wfs = advanceweaponframe($fire3a,$fire3c); if (self.wfs==WF_CYCLE_WRAPPED) if(!self.button0) icestaff_idle(); else icestaff_shard(); else if (self.attack_finished<=time&&self.weaponframe==$fire3a) if(self.artifact_active&ART_TOMEOFPOWER&&self.bluemana>=10) icestaff_blizzard(); else if(!self.artifact_active&ART_TOMEOFPOWER&&self.bluemana>=1) FireFreeze(); else icestaff_idle(); } void icestaff_f4 (void) { self.th_weapon=icestaff_f4; self.wfs = advanceweaponframe($fire4a,$fire4c); if (self.wfs==WF_CYCLE_WRAPPED) if(!self.button0) icestaff_idle(); else icestaff_shard(); else if (self.attack_finished<=time&&self.weaponframe==$fire4a) if(self.artifact_active&ART_TOMEOFPOWER&&self.bluemana>=10) icestaff_blizzard(); else if(!self.artifact_active&ART_TOMEOFPOWER&&self.bluemana>=1) FireFreeze(); else icestaff_idle(); } void icestaff_f5 (void) { self.th_weapon=icestaff_f5; self.wfs = advanceweaponframe($fire5a,$fire5c); if (self.wfs==WF_CYCLE_WRAPPED) if(!self.button0) icestaff_idle(); else icestaff_shard(); else if (self.attack_finished<=time&&self.weaponframe==$fire5a) if(self.artifact_active&ART_TOMEOFPOWER&&self.bluemana>=10) icestaff_blizzard(); else if(!self.artifact_active&ART_TOMEOFPOWER&&self.bluemana>=1) FireFreeze(); else icestaff_idle(); } void icestaff_shard (void) { float r; r=rint(random(4)) + 1; if(r==1) icestaff_f1(); else if(r==2) icestaff_f2(); else if(r==3) icestaff_f3(); else if(r==4) icestaff_f4(); else icestaff_f5(); } void Cru_Ice_Fire (void) { if(self.artifact_active&ART_TOMEOFPOWER) icestaff_blizzard(); else icestaff_shard(); }