# Jedi Knight Cog Script # # ELSE_SNIPED.COG # # Determines at which position the bullet hit to give various disadvantage upon the victim. # # (C) 2000 Hideki # This Cog is Not supported by LucasArts Entertainment Co # symbols int victim local int bullet local int player local template vic_tpl local flex Vertical local flex ToNeck=0.038 local flex ToLeg=0.025 local template S0=stormtroop local template S1=20storm local template S2=rstorm local template S3=stormtroop3 local template S4=stormtroop4 local model Mouse=mb.3do local message touched end # ======================================================================================== code touched: victim = GetSourceRef(); if(GetThingHealth(victim) == 0) return; if( (GetThingType(victim) != 10) && (GetThingType(victim) != 2) ) return; if( (GetActorFlags(victim) & 0x100) || (GetThingModel(victim) == Mouse) ) return; bullet = GetSenderRef(); player = GetThingParent(bullet); vic_tpl = GetThingTemplate(victim); for(i=0; i<=4; i=i+1) if(vic_tpl == S0[i]) ToNeck = 0.015; Vertical = VectorZ(GetThingPos(victim)) - VectorZ(GetThingPos(bullet)); if(Vertical < 0) { if(-Vertical >= ToNeck) { Print("Sniped head!"); DamageThing(victim, GetThingHealth(victim), 0x8, player); } } else { if(Vertical >= ToLeg) { Print("Sniped leg!"); AiSetMoveSpeed(victim, 0.5); SetActorExtraSpeed(victim, -1); } } ToNeck = 0.038; return; end