From: Mario Date: Mon, 22 Aug 2016 08:47:24 +0000 (+1000) Subject: Add a second list for bot dodge entities X-Git-Tag: xonotic-v0.8.2~663^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bd3c00d5a46a5ca6e35a51e64642d2962063cf74;p=xonotic%2Fxonotic-data.pk3dir.git Add a second list for bot dodge entities --- diff --git a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc index 9c6c9f080..0054fd636 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc +++ b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc @@ -835,6 +835,7 @@ void W_Nexball_Attack2(entity actor, .entity weaponentity) missile.effects = EF_BRIGHTFIELD | EF_LOWPRECISION; missile.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, missile); + IL_PUSH(g_bot_dodge, missile); CSQCProjectile(missile, true, PROJECTILE_ELECTRO, true); } diff --git a/qcsrc/common/monsters/monster/mage.qc b/qcsrc/common/monsters/monster/mage.qc index 78608aaeb..628f3e5ea 100644 --- a/qcsrc/common/monsters/monster/mage.qc +++ b/qcsrc/common/monsters/monster/mage.qc @@ -201,6 +201,7 @@ void M_Mage_Attack_Spike(entity this, vector dir) set_movetype(missile, MOVETYPE_FLYMISSILE); missile.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, missile); + IL_PUSH(g_bot_dodge, missile); setorigin(missile, this.origin + v_forward * 14 + '0 0 30' + v_right * -14); setsize(missile, '0 0 0', '0 0 0'); missile.velocity = dir * 400; diff --git a/qcsrc/common/monsters/monster/shambler.qc b/qcsrc/common/monsters/monster/shambler.qc index 3ba01fe21..1abe2e9c8 100644 --- a/qcsrc/common/monsters/monster/shambler.qc +++ b/qcsrc/common/monsters/monster/shambler.qc @@ -150,6 +150,7 @@ void M_Shambler_Attack_Lightning(entity this) gren.angles = vectoangles (gren.velocity); gren.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, gren); + IL_PUSH(g_bot_dodge, gren); CSQCProjectile(gren, true, PROJECTILE_SHAMBLER_LIGHTNING, true); } diff --git a/qcsrc/common/monsters/monster/spider.qc b/qcsrc/common/monsters/monster/spider.qc index 43a07e650..4a0c29a17 100644 --- a/qcsrc/common/monsters/monster/spider.qc +++ b/qcsrc/common/monsters/monster/spider.qc @@ -161,6 +161,7 @@ void M_Spider_Attack_Web(entity this) proj.event_damage = func_null; proj.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, proj); + IL_PUSH(g_bot_dodge, proj); proj.damagedbycontents = true; proj.bouncefactor = 0.3; diff --git a/qcsrc/common/monsters/monster/wyvern.qc b/qcsrc/common/monsters/monster/wyvern.qc index 77980d97a..a05b462a0 100644 --- a/qcsrc/common/monsters/monster/wyvern.qc +++ b/qcsrc/common/monsters/monster/wyvern.qc @@ -36,6 +36,7 @@ METHOD(WyvernAttack, wr_think, void(WyvernAttack thiswep, entity actor, .entity setorigin(missile, actor.origin + actor.view_ofs + v_forward * 14); missile.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, missile); + IL_PUSH(g_bot_dodge, missile); missile.velocity = w_shotdir * (autocvar_g_monster_wyvern_attack_fireball_speed); missile.avelocity = '300 300 300'; missile.nextthink = time + 5; diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index bb347c525..c8114694f 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -293,6 +293,7 @@ void nade_napalm_ball(entity this) proj.angles = vectoangles(proj.velocity); proj.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, proj); + IL_PUSH(g_bot_dodge, proj); proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC; //CSQCProjectile(proj, true, PROJECTILE_NAPALM_FIRE, true); @@ -351,6 +352,7 @@ void nade_napalm_boom(entity this) fountain.origin = this.origin; fountain.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, fountain); + IL_PUSH(g_bot_dodge, fountain); setorigin(fountain, fountain.origin); setthink(fountain, napalm_fountain_think); fountain.nextthink = time; @@ -942,6 +944,7 @@ void toss_nade(entity e, bool set_owner, vector _velocity, float _time) _nade.angles = vectoangles(_nade.velocity); _nade.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, _nade); + IL_PUSH(g_bot_dodge, _nade); _nade.projectiledeathtype = DEATH_NADE.m_id; _nade.toss_time = time; _nade.solid = SOLID_CORPSE; //((_nade.nade_type == NADE_TYPE_TRANSLOCATE) ? SOLID_CORPSE : SOLID_BBOX); diff --git a/qcsrc/common/mutators/mutator/overkill/rpc.qc b/qcsrc/common/mutators/mutator/overkill/rpc.qc index 4540a26f2..122bdfc12 100644 --- a/qcsrc/common/mutators/mutator/overkill/rpc.qc +++ b/qcsrc/common/mutators/mutator/overkill/rpc.qc @@ -97,6 +97,7 @@ void W_RocketPropelledChainsaw_Attack (Weapon thiswep, entity actor, .entity wea missile.nextthink = time; missile.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, missile); + IL_PUSH(g_bot_dodge, missile); CSQCProjectile(missile, true, PROJECTILE_RPC, false); diff --git a/qcsrc/common/turrets/sv_turrets.qc b/qcsrc/common/turrets/sv_turrets.qc index adad91a0b..c90eaff1f 100644 --- a/qcsrc/common/turrets/sv_turrets.qc +++ b/qcsrc/common/turrets/sv_turrets.qc @@ -479,6 +479,7 @@ entity turret_projectile(entity actor, Sound _snd, float _size, float _health, f proj.velocity = normalize(actor.tur_shotdir_updated + randomvec() * actor.shot_spread) * actor.shot_speed; proj.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, proj); + IL_PUSH(g_bot_dodge, proj); proj.enemy = actor.enemy; proj.totalfrags = _death; PROJECTILE_MAKETRIGGER(proj); diff --git a/qcsrc/common/turrets/turret/walker.qc b/qcsrc/common/turrets/turret/walker.qc index 94ecdd332..ffba71439 100644 --- a/qcsrc/common/turrets/turret/walker.qc +++ b/qcsrc/common/turrets/turret/walker.qc @@ -241,6 +241,7 @@ void walker_fire_rocket(entity this, vector org) settouch(rocket, walker_rocket_touch); rocket.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, rocket); + IL_PUSH(g_bot_dodge, rocket); rocket.solid = SOLID_BBOX; rocket.max_health = time + 9; rocket.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_HEAT; diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index cf1f642d4..60a8ee077 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -249,6 +249,7 @@ entity vehicles_projectile(entity this, string _mzlfx, Sound _mzlsound, set_movetype(proj, MOVETYPE_FLYMISSILE); proj.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, proj); + IL_PUSH(g_bot_dodge, proj); proj.bot_dodge = true; proj.bot_dodgerating = _dmg; proj.velocity = _vel; diff --git a/qcsrc/common/weapons/weapon/blaster.qc b/qcsrc/common/weapons/weapon/blaster.qc index 2f24e9e25..2eb8f00b4 100644 --- a/qcsrc/common/weapons/weapon/blaster.qc +++ b/qcsrc/common/weapons/weapon/blaster.qc @@ -140,6 +140,7 @@ void W_Blaster_Attack( settouch(missile, W_Blaster_Touch); missile.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, missile); + IL_PUSH(g_bot_dodge, missile); missile.missile_flags = MIF_SPLASH; missile.projectiledeathtype = atk_deathtype; setthink(missile, W_Blaster_Think); diff --git a/qcsrc/common/weapons/weapon/crylink.qc b/qcsrc/common/weapons/weapon/crylink.qc index be5b2ec28..58214bf39 100644 --- a/qcsrc/common/weapons/weapon/crylink.qc +++ b/qcsrc/common/weapons/weapon/crylink.qc @@ -441,6 +441,7 @@ void W_Crylink_Attack(Weapon thiswep, entity actor, .entity weaponentity) proj.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, proj); + IL_PUSH(g_bot_dodge, proj); proj.missile_flags = MIF_SPLASH; CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true); @@ -557,6 +558,7 @@ void W_Crylink_Attack2(Weapon thiswep, entity actor, .entity weaponentity) proj.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, proj); + IL_PUSH(g_bot_dodge, proj); proj.missile_flags = MIF_SPLASH; CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true); diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index 602afad0b..409f0eab6 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -400,6 +400,7 @@ void W_Devastator_Attack(Weapon thiswep, entity actor, .entity weaponentity) missile.cnt = time + WEP_CVAR(devastator, lifetime); missile.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, missile); + IL_PUSH(g_bot_dodge, missile); missile.missile_flags = MIF_SPLASH; CSQCProjectile(missile, WEP_CVAR(devastator, guiderate) == 0 && WEP_CVAR(devastator, speedaccel) == 0, PROJECTILE_ROCKET, false); // because of fly sound diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index bd6fb8969..a104f952f 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -301,6 +301,7 @@ void W_Electro_Attack_Bolt(Weapon thiswep, entity actor, .entity weaponentity) setsize(proj, '0 0 -3', '0 0 -3'); proj.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, proj); + IL_PUSH(g_bot_dodge, proj); proj.missile_flags = MIF_SPLASH; CSQCProjectile(proj, true, PROJECTILE_ELECTRO_BEAM, true); @@ -448,6 +449,7 @@ void W_Electro_Attack_Orb(Weapon thiswep, entity actor, .entity weaponentity) proj.event_damage = W_Electro_Orb_Damage; proj.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, proj); + IL_PUSH(g_bot_dodge, proj); proj.damagedbycontents = (WEP_CVAR_SEC(electro, damagedbycontents)); proj.bouncefactor = WEP_CVAR_SEC(electro, bouncefactor); diff --git a/qcsrc/common/weapons/weapon/fireball.qc b/qcsrc/common/weapons/weapon/fireball.qc index db87ee445..c2b93747c 100644 --- a/qcsrc/common/weapons/weapon/fireball.qc +++ b/qcsrc/common/weapons/weapon/fireball.qc @@ -224,6 +224,7 @@ void W_Fireball_Attack1(entity actor, .entity weaponentity) setsize(proj, '-16 -16 -16', '16 16 16'); proj.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, proj); + IL_PUSH(g_bot_dodge, proj); proj.missile_flags = MIF_SPLASH | MIF_PROXY; CSQCProjectile(proj, true, PROJECTILE_FIREBALL, true); @@ -355,6 +356,7 @@ void W_Fireball_Attack2(entity actor, .entity weaponentity) proj.angles = vectoangles(proj.velocity); proj.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, proj); + IL_PUSH(g_bot_dodge, proj); proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC; CSQCProjectile(proj, true, PROJECTILE_FIREMINE, true); diff --git a/qcsrc/common/weapons/weapon/hagar.qc b/qcsrc/common/weapons/weapon/hagar.qc index ece4b3589..9a178c03b 100644 --- a/qcsrc/common/weapons/weapon/hagar.qc +++ b/qcsrc/common/weapons/weapon/hagar.qc @@ -171,6 +171,7 @@ void W_Hagar_Attack(Weapon thiswep, entity actor, .entity weaponentity) missile.angles = vectoangles(missile.velocity); missile.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, missile); + IL_PUSH(g_bot_dodge, missile); missile.missile_flags = MIF_SPLASH; CSQCProjectile(missile, true, PROJECTILE_HAGAR, true); @@ -215,6 +216,7 @@ void W_Hagar_Attack2(Weapon thiswep, entity actor, .entity weaponentity) missile.angles = vectoangles(missile.velocity); missile.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, missile); + IL_PUSH(g_bot_dodge, missile); missile.missile_flags = MIF_SPLASH; CSQCProjectile(missile, true, PROJECTILE_HAGAR_BOUNCING, true); @@ -292,6 +294,7 @@ void W_Hagar_Attack2_Load_Release(entity actor, .entity weaponentity) missile.angles = vectoangles(missile.velocity); missile.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, missile); + IL_PUSH(g_bot_dodge, missile); CSQCProjectile(missile, true, PROJECTILE_HAGAR, true); diff --git a/qcsrc/common/weapons/weapon/hlac.qc b/qcsrc/common/weapons/weapon/hlac.qc index c77ccc98e..79bf08193 100644 --- a/qcsrc/common/weapons/weapon/hlac.qc +++ b/qcsrc/common/weapons/weapon/hlac.qc @@ -112,6 +112,7 @@ void W_HLAC_Attack(Weapon thiswep, entity actor, .entity weaponentity) missile.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, missile); + IL_PUSH(g_bot_dodge, missile); missile.projectiledeathtype = WEP_HLAC.m_id; CSQCProjectile(missile, true, PROJECTILE_HLAC, true); @@ -155,6 +156,7 @@ void W_HLAC_Attack2(entity actor, .entity weaponentity) missile.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, missile); + IL_PUSH(g_bot_dodge, missile); missile.missile_flags = MIF_SPLASH; missile.projectiledeathtype = WEP_HLAC.m_id | HITTYPE_SECONDARY; diff --git a/qcsrc/common/weapons/weapon/hook.qc b/qcsrc/common/weapons/weapon/hook.qc index b2c317459..23e7c23ae 100644 --- a/qcsrc/common/weapons/weapon/hook.qc +++ b/qcsrc/common/weapons/weapon/hook.qc @@ -181,6 +181,7 @@ void W_Hook_Attack2(Weapon thiswep, entity actor, .entity weaponentity) gren.angles = '0 0 0'; gren.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, gren); + IL_PUSH(g_bot_dodge, gren); CSQCProjectile(gren, true, PROJECTILE_HOOKBOMB, true); diff --git a/qcsrc/common/weapons/weapon/minelayer.qc b/qcsrc/common/weapons/weapon/minelayer.qc index 568fb6bd4..5f5898aa4 100644 --- a/qcsrc/common/weapons/weapon/minelayer.qc +++ b/qcsrc/common/weapons/weapon/minelayer.qc @@ -104,6 +104,7 @@ void W_MineLayer_Stick(entity this, entity to) newmine.cnt = this.cnt; newmine.flags = this.flags; IL_PUSH(g_projectiles, newmine); + IL_PUSH(g_bot_dodge, newmine); delete(this); @@ -373,6 +374,7 @@ void W_MineLayer_Attack(Weapon thiswep, entity actor, .entity weaponentity) mine.cnt = (WEP_CVAR(minelayer, lifetime) - WEP_CVAR(minelayer, lifetime_countdown)); mine.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, mine); + IL_PUSH(g_bot_dodge, mine); mine.missile_flags = MIF_SPLASH | MIF_ARC | MIF_PROXY; if(mine.cnt > 0) { mine.cnt += time; } diff --git a/qcsrc/common/weapons/weapon/mortar.qc b/qcsrc/common/weapons/weapon/mortar.qc index 81be15654..2206cc57d 100644 --- a/qcsrc/common/weapons/weapon/mortar.qc +++ b/qcsrc/common/weapons/weapon/mortar.qc @@ -248,6 +248,7 @@ void W_Mortar_Attack(Weapon thiswep, entity actor, .entity weaponentity) gren.angles = vectoangles(gren.velocity); gren.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, gren); + IL_PUSH(g_bot_dodge, gren); if(WEP_CVAR_PRI(mortar, type) == 0 || WEP_CVAR_PRI(mortar, type) == 2) CSQCProjectile(gren, true, PROJECTILE_GRENADE, true); @@ -296,6 +297,7 @@ void W_Mortar_Attack2(Weapon thiswep, entity actor, .entity weaponentity) gren.angles = vectoangles(gren.velocity); gren.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, gren); + IL_PUSH(g_bot_dodge, gren); if(WEP_CVAR_SEC(mortar, type) == 0 || WEP_CVAR_SEC(mortar, type) == 2) CSQCProjectile(gren, true, PROJECTILE_GRENADE, true); diff --git a/qcsrc/common/weapons/weapon/porto.qc b/qcsrc/common/weapons/weapon/porto.qc index 717a002cb..3e4654fcb 100644 --- a/qcsrc/common/weapons/weapon/porto.qc +++ b/qcsrc/common/weapons/weapon/porto.qc @@ -278,6 +278,7 @@ void W_Porto_Attack(entity actor, .entity weaponentity, float type) gren.angles = vectoangles(gren.velocity); gren.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, gren); + IL_PUSH(g_bot_dodge, gren); gren.portal_id = time; actor.porto_current = gren; diff --git a/qcsrc/common/weapons/weapon/seeker.qc b/qcsrc/common/weapons/weapon/seeker.qc index 850659069..268e1916e 100644 --- a/qcsrc/common/weapons/weapon/seeker.qc +++ b/qcsrc/common/weapons/weapon/seeker.qc @@ -295,6 +295,7 @@ void W_Seeker_Fire_Missile(Weapon thiswep, entity actor, .entity weaponentity, v set_movetype(missile, MOVETYPE_FLYMISSILE); missile.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, missile); + IL_PUSH(g_bot_dodge, missile); missile.missile_flags = MIF_SPLASH | MIF_GUIDED_TAG; W_SetupProjVelocity_UP_PRE(missile, seeker, missile_); @@ -372,6 +373,7 @@ void W_Seeker_Fire_Flac(Weapon thiswep, entity actor, .entity weaponentity) missile.projectiledeathtype = WEP_SEEKER.m_id | HITTYPE_SECONDARY; missile.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, missile); + IL_PUSH(g_bot_dodge, missile); missile.missile_flags = MIF_SPLASH; // csqc projectiles @@ -594,6 +596,7 @@ void W_Seeker_Fire_Tag(Weapon thiswep, entity actor, .entity weaponentity) missile.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, missile); + IL_PUSH(g_bot_dodge, missile); //missile.missile_flags = MIF_..?; set_movetype(missile, MOVETYPE_FLY); diff --git a/qcsrc/common/weapons/weapon/vaporizer.qc b/qcsrc/common/weapons/weapon/vaporizer.qc index d9c215e24..e11e4d8d5 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@ -289,6 +289,7 @@ void W_RocketMinsta_Attack2(entity actor, .entity weaponentity) setsize(proj, '0 0 -3', '0 0 -3'); proj.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, proj); + IL_PUSH(g_bot_dodge, proj); proj.missile_flags = MIF_SPLASH; CSQCProjectile(proj, true, PROJECTILE_ROCKETMINSTA_LASER, true); @@ -340,6 +341,7 @@ void W_RocketMinsta_Attack3 (entity actor, .entity weaponentity) setsize(proj, '0 0 -3', '0 0 -3'); proj.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, proj); + IL_PUSH(g_bot_dodge, proj); proj.missile_flags = MIF_SPLASH; CSQCProjectile(proj, true, PROJECTILE_ROCKETMINSTA_LASER, true); diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 6fbff1a96..b03496890 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -469,3 +469,6 @@ STATIC_INIT(g_spawnpoints) { g_spawnpoints = IL_NEW(); } IntrusiveList g_bot_targets; STATIC_INIT(g_bot_targets) { g_bot_targets = IL_NEW(); } + +IntrusiveList g_bot_dodge; +STATIC_INIT(g_bot_dodge) { g_bot_dodge = IL_NEW(); } diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index 46508a919..90266189b 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -371,6 +371,7 @@ void FireGrapplingHook(entity actor) missile.classname = "grapplinghook"; missile.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, missile); + IL_PUSH(g_bot_dodge, missile); set_movetype(missile, ((autocvar_g_balance_grapplehook_gravity) ? MOVETYPE_TOSS : MOVETYPE_FLY)); PROJECTILE_MAKETRIGGER(missile);