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_weapon_machinegun() { spawnfunc_weapon_uzi(); }
12 void spawnfunc_ammo_bullets() { spawnfunc_item_bullets(); }
15 void spawnfunc_ammo_grenades() { spawnfunc_item_rockets(); }
18 void spawnfunc_weapon_lightning() { spawnfunc_weapon_electro(); }
19 void spawnfunc_ammo_lightning() { spawnfunc_item_cells(); }
22 void spawnfunc_weapon_plasmagun() { spawnfunc_weapon_hagar(); }
23 void spawnfunc_ammo_cells() { spawnfunc_item_rockets(); }
26 void spawnfunc_weapon_railgun() { spawnfunc_weapon_rifle(); }
27 void spawnfunc_ammo_slugs() { spawnfunc_item_bullets(); }
30 void spawnfunc_weapon_bfg() { spawnfunc_weapon_crylink(); }
31 void spawnfunc_ammo_bfg() { spawnfunc_item_cells(); }
34 void spawnfunc_ammo_rockets() { spawnfunc_item_rockets(); }
37 void spawnfunc_item_armor_body() { spawnfunc_item_armor_large(); }
38 void spawnfunc_item_armor_combat() { spawnfunc_item_armor_big(); }
39 void spawnfunc_item_armor_shard() { spawnfunc_item_armor_small(); }
40 void spawnfunc_item_enviro() { spawnfunc_item_invincible(); }
42 // weapon remove ent from df
43 void target_init_verify()
46 for(trigger = world; (trigger = find(trigger, classname, "trigger_multiple")); )
47 for(targ = world; (targ = find(targ, targetname, trigger.target)); )
48 if (targ.classname == "target_init" || targ.classname == "target_give" || targ.classname == "target_items")
55 //setsize(targ, trigger.mins, trigger.maxs);
56 //setorigin(targ, trigger.origin);
61 void spawnfunc_target_init()
63 self.spawnflags = 0; // remove all weapons except the ones listed below
64 self.netname = "shotgun"; // keep these weapons through the remove trigger
65 spawnfunc_target_items();
66 InitializeEntity(self, target_init_verify, INITPRIO_FINDTARGET);
69 // weapon give ent from defrag
70 void target_give_init()
73 for (targ = world; (targ = find(targ, targetname, self.target)); ) {
74 if (targ.classname == "weapon_rocketlauncher") {
75 self.ammo_rockets += targ.count * autocvar_g_balance_rocketlauncher_ammo;
76 self.netname = "rocketlauncher";
78 else if (targ.classname == "weapon_plasmagun") {
79 self.ammo_rockets += targ.count * autocvar_g_balance_hagar_primary_ammo;
80 if(self.netname == "")
81 self.netname = "hagar";
83 self.netname = strcat(self.netname, " hagar");
85 else if (targ.classname == "weapon_bfg") {
86 self.ammo_cells += targ.count * autocvar_g_balance_crylink_primary_ammo;
87 if(self.netname == "")
88 self.netname = "crylink";
90 self.netname = strcat(self.netname, " crylink");
92 else if (targ.classname == "weapon_grenadelauncher") {
93 self.ammo_rockets += targ.count * autocvar_g_balance_grenadelauncher_primary_ammo;
94 if(self.netname == "")
95 self.netname = "grenadelauncher";
97 self.netname = strcat(self.netname, " grenadelauncher");
99 else if (targ.classname == "item_armor_body")
100 self.armorvalue = 100;
101 else if (targ.classname == "item_health_mega")
103 //remove(targ); // removing ents in init functions causes havoc, workaround:
104 targ.think = SUB_Remove;
105 targ.nextthink = time;
108 spawnfunc_target_items();
109 InitializeEntity(self, target_init_verify, INITPRIO_FINDTARGET);
112 void spawnfunc_target_give()
114 InitializeEntity(self, target_give_init, INITPRIO_FINDTARGET);
117 //void spawnfunc_item_flight() /* not supported */
118 //void spawnfunc_item_haste() /* not supported */
119 //void spawnfunc_item_health() /* handled in t_quake.qc */
120 //void spawnfunc_item_health_large() /* handled in t_items.qc */
121 //void spawnfunc_item_health_small() /* handled in t_items.qc */
122 //void spawnfunc_item_health_mega() /* handled in t_items.qc */
123 //void spawnfunc_item_invis() /* not supported */
124 //void spawnfunc_item_regen() /* not supported */
125 void spawnfunc_team_CTF_redflag() { spawnfunc_item_flag_team1(); }
126 void spawnfunc_team_CTF_blueflag() { spawnfunc_item_flag_team2(); }
127 void spawnfunc_team_CTF_redplayer() { spawnfunc_info_player_team1(); }
128 void spawnfunc_team_CTF_blueplayer() { spawnfunc_info_player_team2(); }
129 void spawnfunc_team_CTF_redspawn() { spawnfunc_info_player_team1(); }
130 void spawnfunc_team_CTF_bluespawn() { spawnfunc_info_player_team2(); }
132 void spawnfunc_item_flight() { spawnfunc_item_jetpack(); }
140 float DoesQ3ARemoveThisEntity()
142 // Q3 style filters (DO NOT USE, THIS IS COMPAT ONLY)
145 if(!teamplay || g_tdm || g_ctf)
149 if not(!teamplay || g_tdm || g_ctf)
167 // static char *gametypeNames[] = {"ffa", "tournament", "single", "team", "ctf", "oneflag", "obelisk", "harvester", "teamtournament"}
168 gametypename = "ffa";
170 gametypename = "team";
172 gametypename = "tournament";
174 gametypename = "ctf";
176 gametypename = "single";
177 // we do not have the other types (oneflag, obelisk, harvester, teamtournament)
178 if(strstrofs(self.gametype, gametypename, 0) < 0)