]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/t_quake3.qc
Merge branch 'master' into fruitiex/racefixes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / t_quake3.qc
1 //***********************
2 //QUAKE 3 ENTITIES - So people can play quake3 maps with the xonotic weapons
3 //***********************
4
5 // NOTE: for best experience, you need to swap MGs with SGs in the map or it won't have a MG
6
7 // SG -> SG
8 void spawnfunc_ammo_shells()         { spawnfunc_item_shells();         }
9
10 // MG -> MG
11 void spawnfunc_weapon_machinegun()   { spawnfunc_weapon_uzi();          }
12 void spawnfunc_ammo_bullets()        { spawnfunc_item_bullets();        }
13
14 // GL -> Mortar
15 void spawnfunc_ammo_grenades()       { spawnfunc_item_rockets();        }
16
17 // LG -> Electro
18 void spawnfunc_weapon_lightning()    { spawnfunc_weapon_electro();      }
19 void spawnfunc_ammo_lightning()      { spawnfunc_item_cells();          }
20
21 // Plasma -> Hagar
22 void spawnfunc_weapon_plasmagun()    { spawnfunc_weapon_hagar();        }
23 void spawnfunc_ammo_cells()          { spawnfunc_item_rockets();        }
24
25 // Rail -> Rifle
26 void spawnfunc_weapon_railgun()      { spawnfunc_weapon_campingrifle(); }
27 void spawnfunc_ammo_slugs()          { spawnfunc_item_bullets();        }
28
29 // BFG -> Crylink
30 void spawnfunc_weapon_bfg()          { spawnfunc_weapon_crylink();      }
31 void spawnfunc_ammo_bfg()            { spawnfunc_item_cells();          }
32
33 // RL -> RL
34 void spawnfunc_ammo_rockets()        { spawnfunc_item_rockets();        }
35
36 // Armor
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();     }
41
42 // weapon remove ent from df
43 void target_init_verify()
44 {
45         entity trigger, targ;
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")
49                         {
50                                 targ.wait = -2;
51                                 targ.delay = 0;
52
53                                 setsize(targ, trigger.mins, trigger.maxs);
54                                 setorigin(targ, trigger.origin);
55                                 //remove(trigger);
56                         }
57 }
58
59 void spawnfunc_target_init()
60 {
61         self.spawnflags = 0; // remove all weapons except the ones listed below
62         self.netname = "laser uzi"; // keep these weapons through the remove trigger
63         spawnfunc_target_items();
64         InitializeEntity(self, target_init_verify, INITPRIO_FINDTARGET);
65 }
66
67 // weapon give ent from defrag
68 void target_give_init()
69 {
70         entity targ;
71         for (targ = world; (targ = find(targ, targetname, self.target)); ) {
72                 if (targ.classname == "weapon_rocketlauncher") {
73                         self.ammo_rockets += targ.count * cvar("g_balance_rocketlauncher_ammo");
74                         self.netname = "rocketlauncher";
75                 }
76                 else if (targ.classname == "weapon_plasmagun") {
77                         self.ammo_rockets += targ.count * cvar("g_balance_hagar_primary_ammo");
78                         if(self.netname == "")
79                                 self.netname = "hagar";
80                         else
81                                 self.netname = strcat(self.netname, " hagar");
82                 }
83                 else if (targ.classname == "weapon_bfg") {
84                         self.ammo_cells += targ.count * cvar("g_balance_crylink_primary_ammo");
85                         if(self.netname == "")
86                                 self.netname = "crylink";
87                         else
88                                 self.netname = strcat(self.netname, " crylink");
89                 }
90                 else if (targ.classname == "weapon_grenadelauncher") {
91                         self.ammo_rockets += targ.count * cvar("g_balance_grenadelauncher_primary_ammo");
92                         if(self.netname == "")
93                                 self.netname = "grenadelauncher";
94                         else
95                                 self.netname = strcat(self.netname, " grenadelauncher");
96                 }
97                 else if (targ.classname == "item_armor_body")
98                         self.armorvalue = 100;
99                 else if (targ.classname == "item_health_mega")
100                         self.health = 200;
101                 remove(targ);
102         }
103         self.spawnflags = 2;
104         spawnfunc_target_items();
105         InitializeEntity(self, target_init_verify, INITPRIO_FINDTARGET);
106 }
107
108 void spawnfunc_target_give()
109 {
110         InitializeEntity(self, target_give_init, INITPRIO_FINDTARGET);
111 }
112
113 //void spawnfunc_item_flight()       /* not supported */
114 //void spawnfunc_item_haste()        /* not supported */
115 //void spawnfunc_item_health()       /* handled in t_quake.qc */
116 //void spawnfunc_item_health_large() /* handled in t_items.qc */
117 //void spawnfunc_item_health_small() /* handled in t_items.qc */
118 //void spawnfunc_item_health_mega()  /* handled in t_items.qc */
119 //void spawnfunc_item_invis()        /* not supported */
120 //void spawnfunc_item_regen()        /* not supported */
121 void spawnfunc_team_CTF_redflag()    { spawnfunc_item_flag_team1();    }
122 void spawnfunc_team_CTF_blueflag()   { spawnfunc_item_flag_team2();    }
123 void spawnfunc_team_CTF_redplayer()  { spawnfunc_info_player_team1();  }
124 void spawnfunc_team_CTF_blueplayer() { spawnfunc_info_player_team2();  }
125 void spawnfunc_team_CTF_redspawn()   { spawnfunc_info_player_team1();  }
126 void spawnfunc_team_CTF_bluespawn()  { spawnfunc_info_player_team2();  }
127
128 void spawnfunc_item_flight()         { spawnfunc_item_jetpack();       }