#pragma once
// special spawn flags
- const int MONSTER_RESPAWN_DEATHPOINT = 16; // re-spawn where we died
- const int MONSTER_TYPE_FLY = 32;
- const int MONSTER_TYPE_SWIM = 64;
- const int MONSTER_SIZE_BROKEN = 128; // TODO: remove when bad models are replaced
- const int MON_FLAG_SUPERMONSTER = 256; // incredibly powerful monster
- const int MON_FLAG_RANGED = 512; // monster shoots projectiles
- const int MON_FLAG_MELEE = 1024;
- const int MON_FLAG_CRUSH = 2048; // monster can be stomped in special modes
- const int MON_FLAG_RIDE = 4096; // monster can be ridden in special modes
- const int MONSTER_SIZE_QUAKE = 8192;
+ const int MONSTER_RESPAWN_DEATHPOINT = BIT(4); // re-spawn where we died
+ const int MONSTER_TYPE_FLY = BIT(5);
+ const int MONSTER_TYPE_SWIM = BIT(6);
+ const int MONSTER_SIZE_BROKEN = BIT(7); // TODO: remove when bad models are replaced
+ const int MON_FLAG_SUPERMONSTER = BIT(8); // incredibly powerful monster
+ const int MON_FLAG_RANGED = BIT(9); // monster shoots projectiles
+ const int MON_FLAG_MELEE = BIT(10);
+ const int MON_FLAG_CRUSH = BIT(11); // monster can be stomped in special modes
+ const int MON_FLAG_RIDE = BIT(12); // monster can be ridden in special modes
+ const int MONSTER_SIZE_QUAKE = BIT(13);
+ const int MONSTER_TYPE_PASSIVE = BIT(14); // doesn't target or chase enemies
// entity properties of monsterinfo:
-.bool(int, entity actor, entity targ) monster_attackfunc;
+.bool(int, entity actor, entity targ, .entity weaponentity) monster_attackfunc;
// animations
.vector anim_blockend;
||
forbidWeaponUse(this.owner)
||
- PS(this.owner).m_switchweapon != WEP_ARC
++ this.owner.(weaponentity).m_switchweapon != WEP_ARC
+ ||
(!PHYS_INPUT_BUTTON_ATCK(this.owner) && !burst )
||
this.owner.vehicle
{
// loadable hagar secondary attack, must always run each frame
- if(time < game_starttime)
+ if(time < game_starttime || PS(actor).m_switchweapon != WEP_HAGAR)
return;
- bool loaded = actor.hagar_load >= WEP_CVAR_SEC(hagar, load_max);
+ bool loaded = actor.(weaponentity).hagar_load >= WEP_CVAR_SEC(hagar, load_max);
// this is different than WR_CHECKAMMO when it comes to reloading
bool enough_ammo;
void W_Hagar_Attack_Auto(Weapon thiswep, entity actor, .entity weaponentity, int fire)
{
- if(!(fire & 1) || actor.(weaponentity).hagar_load || actor.(weaponentity).hagar_loadblock)
- if(!(fire & 1) || actor.hagar_load || actor.hagar_loadblock || PS(actor).m_switchweapon != WEP_HAGAR)
++ if(!(fire & 1) || actor.(weaponentity).hagar_load || actor.(weaponentity).hagar_loadblock || actor.(weaponentity).m_switchweapon != WEP_HAGAR)
{
w_ready(thiswep, actor, weaponentity, fire);
return;
}
}
-METHOD(Tuba, wr_setup, void(Tuba this, entity actor))
+METHOD(Tuba, wr_setup, void(Tuba this, entity actor, .entity weaponentity))
{
- actor.ammo_field = ammo_none;
- actor.tuba_instrument = 0;
+ actor.(weaponentity).tuba_instrument = 0;
}
-#endif
-REGISTER_NET_S2C(tuba_instrument)
-#ifdef CSQC
-NET_HANDLE(tuba_instrument, bool)
-{
- int i = ReadByte();
- return = true;
- string s = (i == 0) ? "tuba" :
- (i == 1) ? "akordeon" :
- "kleinbottle" ;
- CL_WeaponEntity_SetModel(viewmodel, s, true);
-}
-#endif
-#ifdef SVQC
-void tuba_instrument_send(entity this, int instr)
-{
- msg_entity = this;
- if (!IS_REAL_CLIENT(this))
- return;
- int chan = MSG_ONE;
- WriteHeader(chan, tuba_instrument);
- WriteByte(chan, instr);
-}
--SPECTATE_COPY()
--{
- for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
- {
- .entity weaponentity = weaponentities[slot];
- this.(weaponentity).tuba_instrument = spectatee.(weaponentity).tuba_instrument;
- }
- if (this.tuba_instrument != spectatee.tuba_instrument)
- tuba_instrument_send(this, this.tuba_instrument = spectatee.tuba_instrument);
--}
METHOD(Tuba, wr_reload, void(Tuba this, entity actor, .entity weaponentity))
{
// switch to alternate instruments :)