1 //***********************
2 //QUAKE 3 ENTITIES - So people can play quake3 maps with the xonotic weapons
3 //***********************
5 // NOTE: for best experience, you need to swap MGs with SGs in the map or it won't have a MG
8 void spawnfunc_ammo_shells() { spawnfunc_item_shells(); }
11 void spawnfunc_ammo_bullets() { spawnfunc_item_bullets(); }
14 void spawnfunc_ammo_grenades() { spawnfunc_item_rockets(); }
17 void spawnfunc_weapon_lightning() { spawnfunc_weapon_electro(); }
18 void spawnfunc_ammo_lightning() { spawnfunc_item_cells(); }
21 void spawnfunc_weapon_plasmagun() { spawnfunc_weapon_hagar(); }
22 void spawnfunc_ammo_cells() { spawnfunc_item_rockets(); }
25 void spawnfunc_weapon_railgun() { spawnfunc_weapon_vortex(); }
26 void spawnfunc_ammo_slugs() { spawnfunc_item_plasma(); }
29 void spawnfunc_weapon_bfg() { spawnfunc_weapon_crylink(); }
30 void spawnfunc_ammo_bfg() { spawnfunc_item_plasma(); }
33 void spawnfunc_ammo_rockets() { spawnfunc_item_rockets(); }
36 void spawnfunc_item_armor_body() { spawnfunc_item_armor_large(); }
37 void spawnfunc_item_armor_combat() { spawnfunc_item_armor_big(); }
38 void spawnfunc_item_armor_shard() { spawnfunc_item_armor_small(); }
39 void spawnfunc_item_enviro() { spawnfunc_item_invincible(); }
41 // weapon remove ent from df
42 void target_init_verify()
45 for(trigger = world; (trigger = find(trigger, classname, "trigger_multiple")); )
46 for(targ = world; (targ = find(targ, targetname, trigger.target)); )
47 if (targ.classname == "target_init" || targ.classname == "target_give" || targ.classname == "target_items")
54 //setsize(targ, trigger.mins, trigger.maxs);
55 //setorigin(targ, trigger.origin);
60 void spawnfunc_target_init()
62 self.spawnflags = 0; // remove all weapons except the ones listed below
63 self.netname = "shotgun"; // keep these weapons through the remove trigger
64 spawnfunc_target_items();
65 InitializeEntity(self, target_init_verify, INITPRIO_FINDTARGET);
68 // weapon give ent from defrag
69 void target_give_init()
72 for (targ = world; (targ = find(targ, targetname, self.target)); ) {
73 if (targ.classname == "weapon_rocketlauncher" || targ.classname == "weapon_devastator") {
74 self.ammo_rockets += targ.count * WEP_CVAR(devastator, ammo);
75 self.netname = "devastator";
77 else if (targ.classname == "weapon_plasmagun") {
78 self.ammo_rockets += targ.count * WEP_CVAR_PRI(hagar, ammo); // WEAPONTODO
79 if(self.netname == "")
80 self.netname = "hagar";
82 self.netname = strcat(self.netname, " hagar");
84 else if (targ.classname == "weapon_bfg") {
85 self.ammo_cells += targ.count * WEP_CVAR_PRI(crylink, ammo);
86 if(self.netname == "")
87 self.netname = "crylink";
89 self.netname = strcat(self.netname, " crylink");
91 else if (targ.classname == "weapon_grenadelauncher" || targ.classname == "weapon_mortar") {
92 self.ammo_rockets += targ.count * WEP_CVAR_PRI(mortar, ammo); // WEAPONTODO
93 if(self.netname == "")
94 self.netname = "mortar";
96 self.netname = strcat(self.netname, " mortar");
98 else if (targ.classname == "item_armor_body")
99 self.armorvalue = 100;
100 else if (targ.classname == "item_health_mega")
102 //remove(targ); // removing ents in init functions causes havoc, workaround:
103 targ.think = SUB_Remove;
104 targ.nextthink = time;
107 spawnfunc_target_items();
108 InitializeEntity(self, target_init_verify, INITPRIO_FINDTARGET);
111 void spawnfunc_target_give()
113 InitializeEntity(self, target_give_init, INITPRIO_FINDTARGET);
116 //void spawnfunc_item_flight() /* handled by buffs mutator or jetpack */
117 //void spawnfunc_item_haste() /* handled by buffs mutator */
118 //void spawnfunc_item_health() /* handled in t_quake.qc */
119 //void spawnfunc_item_health_large() /* handled in t_items.qc */
120 //void spawnfunc_item_health_small() /* handled in t_items.qc */
121 //void spawnfunc_item_health_mega() /* handled in t_items.qc */
122 //void spawnfunc_item_invis() /* handled by buffs mutator */
123 //void spawnfunc_item_regen() /* handled by buffs mutator */
125 // CTF spawnfuncs handled in mutators/gamemode_ctf.qc now
127 void spawnfunc_item_flight()
129 if(!cvar("g_buffs") || !cvar("g_buffs_flight"))
130 spawnfunc_item_jetpack();
132 buff_Init_Compat(self, BUFF_FLIGHT);
141 float DoesQ3ARemoveThisEntity()
143 // Q3 style filters (DO NOT USE, THIS IS COMPAT ONLY)
146 if(!teamplay || g_tdm || g_ctf)
150 if (!(!teamplay || g_tdm || g_ctf))
168 // static char *gametypeNames[] = {"ffa", "tournament", "single", "team", "ctf", "oneflag", "obelisk", "harvester", "teamtournament"}
169 gametypename = "ffa";
171 gametypename = "team";
173 gametypename = "ctf";
175 gametypename = "single";
176 // we do not have the other types (oneflag, obelisk, harvester, teamtournament)
177 if(strstrofs(self.gametype, gametypename, 0) < 0)