コード例 #1
0
DEFINE_ACTION_FUNCTION(AActor, A_FireSigil4)
{
	PARAM_ACTION_PROLOGUE;

	AActor *spot;
	player_t *player = self->player;
	FTranslatedLineTarget t;

	if (player == NULL || player->ReadyWeapon == NULL)
		return 0;

	P_DamageMobj (self, self, NULL, 4*4, 0, DMG_NO_ARMOR);
	S_Sound (self, CHAN_WEAPON, "weapons/sigilcharge", 1, ATTN_NORM);

	P_BulletSlope (self, &t, ALF_PORTALRESTRICT);
	if (t.linetarget != NULL)
	{
		spot = P_SpawnPlayerMissile (self, 0,0,0, PClass::FindActor("SpectralLightningBigV1"), self->Angles.Yaw, &t, NULL, false, false, ALF_PORTALRESTRICT);
		if (spot != NULL)
		{
			spot->tracer = t.linetarget;
		}
	}
	else
	{
		spot = P_SpawnPlayerMissile (self, PClass::FindActor("SpectralLightningBigV1"));
		if (spot != NULL)
		{
			spot->VelFromAngle(self->Angles.Yaw, spot->Speed);
		}
	}
	return 0;
}
コード例 #2
0
ファイル: a_fighterhammer.cpp プロジェクト: WChrisK/Zandronum
DEFINE_ACTION_FUNCTION(AActor, A_FHammerThrow)
{
	AActor *mo;
	player_t *player;

	if (NULL == (player = self->player))
	{
		return;
	}

	if (!player->mo->special1)
	{
		return;
	}
	AWeapon *weapon = player->ReadyWeapon;
	if (weapon != NULL)
	{
		if (!weapon->DepleteAmmo (weapon->bAltFire, false))
			return;
	}

	// [BC] Weapons are handled by the server.
	if (( NETWORK_GetState( ) == NETSTATE_CLIENT ) ||
		( CLIENTDEMO_IsPlaying( )))
	{
		return;
	}

	mo = P_SpawnPlayerMissile (player->mo, PClass::FindClass ("HammerMissile")); 
	if (mo)
	{
		mo->special1 = 0;
	}	

	// [BC] Apply spread.
	if ( player->cheats & CF_SPREAD )
	{
		mo = P_SpawnPlayerMissile( player->mo, PClass::FindClass ("HammerMissile"), self->angle + ( ANGLE_45 / 3 )); 
		if ( mo )
		{
			mo->special1 = 0;
		}	

		mo = P_SpawnPlayerMissile( player->mo, PClass::FindClass ("HammerMissile"), self->angle - ( ANGLE_45 / 3 )); 
		if ( mo )
		{
			mo->special1 = 0;
		}	
	}
}
コード例 #3
0
ファイル: p_pspr.c プロジェクト: alexey-lysiuk/doom64ex-osx
//
// A_FirePlasma
//
void A_FirePlasma(player_t* player, pspdef_t* psp)
{
    player->ammo[weaponinfo[player->readyweapon].ammo]--;
    
    P_SetPsprite (player, ps_flash, S_000);
    P_SpawnPlayerMissile (player->mo, MT_PROJ_PLASMA);
}
コード例 #4
0
ファイル: a_strifeweapons.cpp プロジェクト: Edward850/zdoom
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireArrow)
{
	PARAM_ACTION_PROLOGUE;
	PARAM_CLASS(ti, AActor);

	angle_t savedangle;

	if (self->player == NULL)
		return 0;

	AWeapon *weapon = self->player->ReadyWeapon;
	if (weapon != NULL)
	{
		if (!weapon->DepleteAmmo (weapon->bAltFire))
			return 0;
	}

	if (ti) 
	{
		savedangle = self->angle;
		self->angle += pr_electric.Random2 () << (18 - self->player->mo->accuracy * 5 / 100);
		self->player->mo->PlayAttacking2 ();
		P_SpawnPlayerMissile (self, ti);
		self->angle = savedangle;
		S_Sound (self, CHAN_WEAPON, "weapons/xbowshoot", 1, ATTN_NORM);
	}
	return 0;
}
コード例 #5
0
ファイル: p_pspr.c プロジェクト: Mistranger/prboom-plus
void A_FireBFG(player_t *player, pspdef_t *psp)
{
  CHECK_WEAPON_CODEPOINTER("A_FireBFG", player);

  player->ammo[weaponinfo[player->readyweapon].ammo] -= BFGCELLS;
  P_SpawnPlayerMissile(player->mo, MT_BFG);
}
コード例 #6
0
ファイル: p_pspr.c プロジェクト: Mistranger/prboom-plus
void A_FireMissile(player_t *player, pspdef_t *psp)
{
  CHECK_WEAPON_CODEPOINTER("A_FireMissile", player);

  player->ammo[weaponinfo[player->readyweapon].ammo]--;
  P_SpawnPlayerMissile(player->mo, MT_ROCKET);
}
コード例 #7
0
DEFINE_ACTION_FUNCTION(AActor, A_FHammerThrow)
{
    AActor *mo;
    player_t *player;

    if (NULL == (player = self->player))
    {
        return;
    }

    if (!player->mo->special1)
    {
        return;
    }
    AWeapon *weapon = player->ReadyWeapon;
    if (weapon != NULL)
    {
        if (!weapon->DepleteAmmo (weapon->bAltFire, false))
            return;
    }
    mo = P_SpawnPlayerMissile (player->mo, PClass::FindClass ("HammerMissile"));
    if (mo)
    {
        mo->special1 = 0;
    }
}
コード例 #8
0
ファイル: a_strifeweapons.cpp プロジェクト: Edward850/zdoom
DEFINE_ACTION_FUNCTION(AActor, A_FireFlamer)
{
	PARAM_ACTION_PROLOGUE;

	player_t *player = self->player;

	if (player != NULL)
	{
		AWeapon *weapon = self->player->ReadyWeapon;
		if (weapon != NULL)
		{
			if (!weapon->DepleteAmmo (weapon->bAltFire))
				return 0;
		}
		player->mo->PlayAttacking2 ();
	}

	self->angle += pr_flamethrower.Random2() << 18;
	self = P_SpawnPlayerMissile (self, PClass::FindActor("FlameMissile"));
	if (self != NULL)
	{
		self->velz += 5*FRACUNIT;
	}
	return 0;
}
コード例 #9
0
ファイル: p_pspr.cpp プロジェクト: rlsosborne/doom
OVERLAY void A_FirePlasma(player_t *player, pspdef_t *psp)
{
  player->ammo[weaponinfo[player->readyweapon].ammo]--;

  A_FireSomething(player,P_Random(pr_plasma)&1);              // phares
  P_SpawnPlayerMissile(player->mo, MT_PLASMA);
}
コード例 #10
0
ファイル: p_pspr.c プロジェクト: arneolavhal/doomretro
//
// A_FirePlasma
//
void A_FirePlasma(player_t *player, pspdef_t *psp)
{
    player->ammo[weaponinfo[player->readyweapon].ammo]--;

    P_SetPsprite(player, ps_flash,
                 (statenum_t)(weaponinfo[player->readyweapon].flashstate + (P_Random() & 1)));

    P_SpawnPlayerMissile(player->mo, MT_PLASMA);
}
コード例 #11
0
ファイル: p_pspr.cpp プロジェクト: JohnnyonFlame/odamex
//
// A_FireMissile
//
void A_FireMissile (AActor *mo)
{
    player_t *player = mo->player;

	DecreaseAmmo(player);

	if(serverside)
		P_SpawnPlayerMissile (player->mo, MT_ROCKET);
}
コード例 #12
0
ファイル: p_pspr.c プロジェクト: Mistranger/prboom-plus
void A_FirePlasma(player_t *player, pspdef_t *psp)
{
  CHECK_WEAPON_CODEPOINTER("A_FirePlasma", player);

  player->ammo[weaponinfo[player->readyweapon].ammo]--;

  A_FireSomething(player,P_Random(pr_plasma)&1);              // phares
  P_SpawnPlayerMissile(player->mo, MT_PLASMA);
}
コード例 #13
0
ファイル: p_pspr.c プロジェクト: alexey-lysiuk/doom64ex-osx
void A_FireMissile(player_t* player, pspdef_t* psp)
{
    player->ammo[weaponinfo[player->readyweapon].ammo]--;
    P_SpawnPlayerMissile (player->mo, MT_PROJ_ROCKET);
    
    player->recoilpitch = RECOILPITCH;
    
    if(player->onground)
        P_Thrust(player, player->mo->angle + ANG180, FRACUNIT);
}
コード例 #14
0
ファイル: a_magecone.cpp プロジェクト: Edward850/zdoom
DEFINE_ACTION_FUNCTION(AActor, A_FireConePL1)
{
	PARAM_ACTION_PROLOGUE;

	angle_t angle;
	int damage;
	int slope;
	int i;
	AActor *mo;
	bool conedone=false;
	player_t *player;
	AActor *linetarget;

	if (NULL == (player = self->player))
	{
		return 0;
	}

	AWeapon *weapon = self->player->ReadyWeapon;
	if (weapon != NULL)
	{
		if (!weapon->DepleteAmmo (weapon->bAltFire))
			return 0;
	}
	S_Sound (self, CHAN_WEAPON, "MageShardsFire", 1, ATTN_NORM);

	damage = 90+(pr_cone()&15);
	for (i = 0; i < 16; i++)
	{
		angle = self->angle+i*(ANG45/16);
		slope = P_AimLineAttack (self, angle, MELEERANGE, &linetarget, 0, ALF_CHECK3D);
		if (linetarget)
		{
			P_DamageMobj (linetarget, self, self, damage, NAME_Ice);
			conedone = true;
			break;
		}
	}

	// didn't find any creatures, so fire projectiles
	if (!conedone)
	{
		mo = P_SpawnPlayerMissile (self, RUNTIME_CLASS(AFrostMissile));
		if (mo)
		{
			mo->special1 = SHARDSPAWN_LEFT|SHARDSPAWN_DOWN|SHARDSPAWN_UP
				|SHARDSPAWN_RIGHT;
			mo->special2 = 3; // Set sperm count (levels of reproductivity)
			mo->target = self;
			mo->args[0] = 3;		// Mark Initial shard as super damage
		}
	}
	return 0;
}
コード例 #15
0
ファイル: a_teleportother.cpp プロジェクト: ChillyDoom/zdoom
bool AArtiTeleportOther::Use (bool pickup)
{
	AActor *mo;

	mo = P_SpawnPlayerMissile (Owner, RUNTIME_CLASS(ATelOtherFX1));
	if (mo)
	{
		mo->target = Owner;
	}
	return true;
}
コード例 #16
0
ファイル: a_summon.cpp プロジェクト: BenJamesbabala/ViZDoom
bool AArtiDarkServant::Use (bool pickup)
{
	AActor *mo = P_SpawnPlayerMissile (Owner, PClass::FindClass ("SummoningDoll"));
	if (mo)
	{
		mo->target = Owner;
		mo->tracer = Owner;
		mo->velz = 5*FRACUNIT;
	}
	return true;
}
コード例 #17
0
ファイル: p_pspr.cpp プロジェクト: JohnnyonFlame/odamex
//
// A_FirePlasma
//
void A_FirePlasma (AActor *mo)
{
    player_t *player = mo->player;

	DecreaseAmmo(player);

	P_SetPsprite (player,
				  ps_flash,
				  (statenum_t)(weaponinfo[player->readyweapon].flashstate+(P_Random (player->mo)&1)));

	if(serverside)
		P_SpawnPlayerMissile (player->mo, MT_PLASMA);
}
コード例 #18
0
DEFINE_ACTION_FUNCTION(AActor, A_CFlameAttack)
{
	player_t *player;

	if (NULL == (player = self->player))
	{
		return;
	}
	AWeapon *weapon = self->player->ReadyWeapon;
	if (weapon != NULL)
	{
		if (!weapon->DepleteAmmo (weapon->bAltFire))
			return;
	}

	// [BC] Weapons are handled by the server.
	if (( NETWORK_GetState( ) == NETSTATE_CLIENT ) ||
		( CLIENTDEMO_IsPlaying( )))
	{
		S_Sound (self, CHAN_WEAPON, "ClericFlameFire", 1, ATTN_NORM);
		return;
	}

	P_SpawnPlayerMissile (self, RUNTIME_CLASS(ACFlameMissile));
	
	// [BC] Apply spread.
	if ( player->cheats & CF_SPREAD )
	{
		P_SpawnPlayerMissile( self, RUNTIME_CLASS(ACFlameMissile), self->angle + ( ANGLE_45 / 3 ));
		P_SpawnPlayerMissile( self, RUNTIME_CLASS(ACFlameMissile), self->angle - ( ANGLE_45 / 3 ));
	}

	S_Sound (self, CHAN_WEAPON, "ClericFlameFire", 1, ATTN_NORM);

	// [BC] If we're the server, tell other clients to make the sound.
	if ( NETWORK_GetState( ) == NETSTATE_SERVER )
		SERVERCOMMANDS_WeaponSound( ULONG( player - players ), "ClericFlameFire", ULONG( player - players ), SVCF_SKIPTHISCLIENT );
}
コード例 #19
0
DEFINE_ACTION_FUNCTION(AActor, A_FireSigil5)
{
	PARAM_ACTION_PROLOGUE;

	player_t *player = self->player;

	if (player == NULL || player->ReadyWeapon == NULL)
		return 0;

	P_DamageMobj (self, self, NULL, 5*4, 0, DMG_NO_ARMOR);
	S_Sound (self, CHAN_WEAPON, "weapons/sigilcharge", 1, ATTN_NORM);

	P_SpawnPlayerMissile (self, PClass::FindActor("SpectralLightningBigBall1"));
	return 0;
}
コード例 #20
0
DEFINE_ACTION_FUNCTION(AActor, A_FireMauler2)
{
	if (self->player != NULL)
	{
		AWeapon *weapon = self->player->ReadyWeapon;
		if (weapon != NULL)
		{
			if (!weapon->DepleteAmmo (weapon->bAltFire))
				return;
		}
		self->player->mo->PlayAttacking2 ();
	}
	P_SpawnPlayerMissile (self, PClass::FindClass("MaulerTorpedo"));
	P_DamageMobj (self, self, NULL, 20, self->DamageType);
	P_ThrustMobj (self, self->angle + ANGLE_180, 0x7D000);
}
コード例 #21
0
bool AArtiTeleportOther::Use (bool pickup)
{
	AActor *mo;

	// [BC] Weapons are handled by the server.
	if ( NETWORK_InClientMode() )
	{
		return ( true );
	}

	mo = P_SpawnPlayerMissile (Owner, RUNTIME_CLASS(ATelOtherFX1));
	if (mo)
	{
		mo->target = Owner;
	}
	return true;
}
コード例 #22
0
ファイル: p_pspr.cpp プロジェクト: JohnnyonFlame/odamex
void A_FireBFG (AActor *mo)
{
    player_t *player = mo->player;

	// [RH] bfg can be forced to not use freeaim
	angle_t storedpitch = player->mo->pitch;
	int storedaimdist = player->userinfo.aimdist;

	DecreaseAmmo(player);

	player->mo->pitch = 0;
	player->userinfo.aimdist = 81920000;

	if(serverside)
		P_SpawnPlayerMissile (player->mo, MT_BFG);

	player->mo->pitch = storedpitch;
	player->userinfo.aimdist = storedaimdist;
}
コード例 #23
0
ファイル: a_doomweaps.cpp プロジェクト: FlameNeon/gzdoom
//
// A_FireMissile
//
DEFINE_ACTION_FUNCTION(AActor, A_FireMissile)
{
	PARAM_ACTION_PROLOGUE;

	player_t *player;

	if (NULL == (player = self->player))
	{
		return 0;
	}
	AWeapon *weapon = self->player->ReadyWeapon;
	if (weapon != NULL && ACTION_CALL_FROM_WEAPON())
	{
		if (!weapon->DepleteAmmo (weapon->bAltFire, true, 1))
			return 0;
	}
	P_SpawnPlayerMissile (self, PClass::FindActor("Rocket"));
	return 0;
}
コード例 #24
0
DEFINE_ACTION_FUNCTION(AActor, A_FireMauler2)
{
	PARAM_ACTION_PROLOGUE;

	if (self->player != NULL)
	{
		AWeapon *weapon = self->player->ReadyWeapon;
		if (weapon != NULL)
		{
			if (!weapon->DepleteAmmo (weapon->bAltFire))
				return 0;
		}
		self->player->mo->PlayAttacking2 ();
	}
	P_SpawnPlayerMissile (self, PClass::FindActor("MaulerTorpedo"));
	P_DamageMobj (self, self, NULL, 20, self->DamageType);
	self->Thrust(self->Angles.Yaw+180., 7.8125);
	return 0;
}
コード例 #25
0
DEFINE_ACTION_FUNCTION(AActor, A_FireMiniMissile)
{
	player_t *player = self->player;
	angle_t savedangle;

	if (self->player == NULL)
		return;

	AWeapon *weapon = self->player->ReadyWeapon;
	if (weapon != NULL)
	{
		if (!weapon->DepleteAmmo (weapon->bAltFire))
			return;
	}

	savedangle = self->angle;
	self->angle += pr_minimissile.Random2() << (19 - player->mo->accuracy * 5 / 100);
	player->mo->PlayAttacking2 ();
	P_SpawnPlayerMissile (self, PClass::FindClass("MiniMissile"));
	self->angle = savedangle;
}
コード例 #26
0
DEFINE_ACTION_FUNCTION(AActor, A_FireMiniMissile)
{
	PARAM_ACTION_PROLOGUE;

	player_t *player = self->player;
	DAngle savedangle;

	if (self->player == NULL)
		return 0;

	AWeapon *weapon = self->player->ReadyWeapon;
	if (weapon != NULL)
	{
		if (!weapon->DepleteAmmo (weapon->bAltFire))
			return 0;
	}

	savedangle = self->Angles.Yaw;
	self->Angles.Yaw += pr_minimissile.Random2() * (11.25 / 256) * player->mo->AccuracyFactor();
	player->mo->PlayAttacking2 ();
	P_SpawnPlayerMissile (self, PClass::FindActor("MiniMissile"));
	self->Angles.Yaw = savedangle;
	return 0;
}
コード例 #27
0
ファイル: p_pspr.cpp プロジェクト: rlsosborne/doom
OVERLAY void A_FireBFG(player_t *player, pspdef_t *psp)
{
  player->ammo[weaponinfo[player->readyweapon].ammo] -= BFGCELLS;
  P_SpawnPlayerMissile(player->mo, MT_BFG);
}
コード例 #28
0
ファイル: p_pspr.cpp プロジェクト: rlsosborne/doom
OVERLAY void A_FireMissile(player_t *player, pspdef_t *psp)
{
  player->ammo[weaponinfo[player->readyweapon].ammo]--;
  P_SpawnPlayerMissile(player->mo, MT_ROCKET);
}
コード例 #29
0
DEFINE_ACTION_FUNCTION(AActor, A_FireConePL1)
{
	angle_t angle;
	int damage;
	int slope;
	int i;
	AActor *mo;
	bool conedone=false;
	player_t *player;
	AActor *linetarget;

	if (NULL == (player = self->player))
	{
		return;
	}

	AWeapon *weapon = self->player->ReadyWeapon;
	if (weapon != NULL)
	{
		if (!weapon->DepleteAmmo (weapon->bAltFire))
			return;
	}
	S_Sound (self, CHAN_WEAPON, "MageShardsFire", 1, ATTN_NORM);

	// [BC] Weapons are handled by the server.
	if (( NETWORK_GetState( ) == NETSTATE_CLIENT ) ||
		( CLIENTDEMO_IsPlaying( )))
	{
		return;
	}

	// [BC] If we're the server, play the sound.
	if ( NETWORK_GetState( ) == NETSTATE_SERVER )
		SERVERCOMMANDS_WeaponSound( ULONG( player - players ), "MageShardsFire", ULONG( player - players ), SVCF_SKIPTHISCLIENT );

	damage = 90+(pr_cone()&15);
	for (i = 0; i < 16; i++)
	{
		angle = self->angle+i*(ANG45/16);
		slope = P_AimLineAttack (self, angle, MELEERANGE, &linetarget, 0, false, true);
		if (linetarget)
		{
			P_DamageMobj (linetarget, self, self, damage, NAME_Ice);

			// [BC] Apply spread.
			if ( player->cheats & CF_SPREAD )
				P_DamageMobj (linetarget, self, self, damage * 2, NAME_Ice);

			conedone = true;
			break;
		}
	}

	// didn't find any creatures, so fire projectiles
	if (!conedone)
	{
		mo = P_SpawnPlayerMissile (self, RUNTIME_CLASS(AFrostMissile));
		if (mo)
		{
			mo->special1 = SHARDSPAWN_LEFT|SHARDSPAWN_DOWN|SHARDSPAWN_UP
				|SHARDSPAWN_RIGHT;
			mo->special2 = 3; // Set sperm count (levels of reproductivity)
			mo->target = self;
			mo->args[0] = 3;		// Mark Initial shard as super damage
		}

		// [BC] Apply spread.
		if ( player->cheats & CF_SPREAD )
		{
			mo = P_SpawnPlayerMissile (self, RUNTIME_CLASS(AFrostMissile), self->angle + ( ANGLE_45 / 3 ));
			if (mo)
			{
				mo->special1 = SHARDSPAWN_LEFT|SHARDSPAWN_DOWN|SHARDSPAWN_UP
					|SHARDSPAWN_RIGHT;
				mo->special2 = 3; // Set sperm count (levels of reproductivity)
				mo->target = self;
				mo->args[0] = 3;		// Mark Initial shard as super damage
			}

			mo = P_SpawnPlayerMissile (self, RUNTIME_CLASS(AFrostMissile), self->angle - ( ANGLE_45 / 3 ));
			if (mo)
			{
				mo->special1 = SHARDSPAWN_LEFT|SHARDSPAWN_DOWN|SHARDSPAWN_UP
					|SHARDSPAWN_RIGHT;
				mo->special2 = 3; // Set sperm count (levels of reproductivity)
				mo->target = self;
				mo->args[0] = 3;		// Mark Initial shard as super damage
			}
		}
	}
}
コード例 #30
0
//============================================================================
//
// A_MLightningAttack
//
//============================================================================

DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MLightningAttack)
{
	PARAM_ACTION_PROLOGUE;
	PARAM_CLASS_OPT(floor, AActor)		{ floor = PClass::FindActor("LightningFloor"); }
	PARAM_CLASS_OPT(ceiling, AActor)	{ ceiling = PClass::FindActor("LightningCeiling"); }

	AActor *fmo, *cmo;

	fmo = P_SpawnPlayerMissile (self, floor);
	cmo = P_SpawnPlayerMissile (self, ceiling);
	if (fmo)
	{
		fmo->special1 = 0;
		fmo->lastenemy = cmo;
		CALL_ACTION(A_LightningZap, fmo);	
	}
	if (cmo)
	{
		cmo->tracer = NULL;
		cmo->lastenemy = fmo;
		CALL_ACTION(A_LightningZap, cmo);	
	}
	S_Sound (self, CHAN_BODY, "MageLightningFire", 1, ATTN_NORM);