DEFINE_ACTION_FUNCTION(AActor, A_Srcr2Attack) { int chance; if (!self->target) { return; } S_Sound (self, CHAN_BODY, self->AttackSound, 1, ATTN_NONE); if (self->CheckMeleeRange()) { int damage = pr_s2a.HitDice (20); int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee); P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self); return; } chance = self->health < self->SpawnHealth()/2 ? 96 : 48; if (pr_s2a() < chance) { // Wizard spawners const PClass *fx = PClass::FindClass("Sorcerer2FX2"); if (fx) { P_SpawnMissileAngle (self, fx, self->angle-ANG45, FRACUNIT/2); P_SpawnMissileAngle (self, fx, self->angle+ANG45, FRACUNIT/2); } } else { // Blue bolt P_SpawnMissile (self, self->target, PClass::FindClass("Sorcerer2FX1")); } }
void A_Srcr2Attack (AActor *actor) { int chance; if (!actor->target) { return; } S_SoundID (actor, CHAN_BODY, actor->AttackSound, 1, ATTN_NONE); if (actor->CheckMeleeRange()) { int damage = pr_s2a.HitDice (20); P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee); P_TraceBleed (damage, actor->target, actor); return; } chance = actor->health < actor->GetDefault()->health/2 ? 96 : 48; if (pr_s2a() < chance) { // Wizard spawners P_SpawnMissileAngle (actor, RUNTIME_CLASS(ASorcerer2FX2), actor->angle-ANG45, FRACUNIT/2); P_SpawnMissileAngle (actor, RUNTIME_CLASS(ASorcerer2FX2), actor->angle+ANG45, FRACUNIT/2); } else { // Blue bolt P_SpawnMissile (actor, actor->target, RUNTIME_CLASS(ASorcerer2FX1)); } }
DEFINE_ACTION_FUNCTION(AActor, A_WizAtk3) { AActor *mo; CALL_ACTION(A_GhostOff, self); // [BB] This is server-side, the client only needs to run A_GhostOff. if (( NETWORK_GetState( ) == NETSTATE_CLIENT ) || ( CLIENTDEMO_IsPlaying( ))) { return; } if (!self->target) { return; } S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM); // [BB] If we're the server, tell the clients to play the sound. if ( NETWORK_GetState( ) == NETSTATE_SERVER ) SERVERCOMMANDS_SoundActor( self, CHAN_WEAPON, S_GetName( self->AttackSound ), 1, ATTN_NORM ); if (self->CheckMeleeRange()) { int damage = pr_wizatk3.HitDice (4); P_DamageMobj (self->target, self, self, damage, NAME_Melee); P_TraceBleed (damage, self->target, self); return; } const PClass *fx = PClass::FindClass("WizardFX1"); mo = P_SpawnMissile (self, self->target, fx); if (mo != NULL) { AActor *missile1 = P_SpawnMissileAngle(self, fx, mo->angle-(ANG45/8), mo->velz); AActor *missile2 = P_SpawnMissileAngle(self, fx, mo->angle+(ANG45/8), mo->velz); // [BB] If we're the server, tell the clients to spawn the missiles. if ( NETWORK_GetState( ) == NETSTATE_SERVER ) { SERVERCOMMANDS_SpawnMissile( mo ); if ( missile1 ) SERVERCOMMANDS_SpawnMissile( missile1 ); if ( missile2 ) SERVERCOMMANDS_SpawnMissile( missile2 ); } } }
void A_WizAtk3 (AActor *actor) { AActor *mo; A_GhostOff (actor); if (!actor->target) { return; } S_SoundID (actor, CHAN_WEAPON, actor->AttackSound, 1, ATTN_NORM); if (actor->CheckMeleeRange()) { int damage = pr_wizatk3.HitDice (4); P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee); P_TraceBleed (damage, actor->target, actor); return; } mo = P_SpawnMissile (actor, actor->target, RUNTIME_CLASS(AWizardFX1)); if (mo != NULL) { P_SpawnMissileAngle(actor, RUNTIME_CLASS(AWizardFX1), mo->angle-(ANG45/8), mo->momz); P_SpawnMissileAngle(actor, RUNTIME_CLASS(AWizardFX1), mo->angle+(ANG45/8), mo->momz); } }