]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/t_quake3.qc
properly draw the hook through warpzones again too; fix interpolation issues
[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 -> Nex                                   
26 void spawnfunc_weapon_railgun()      { spawnfunc_weapon_nex();         }
27 void spawnfunc_ammo_slugs()          { spawnfunc_item_cells();         }
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 defrag
43 void spawnfunc_target_init()         
44 {
45         self.spawnflags = 0; // remove all weapons except the ones listed below
46         self.netname = "laser uzi"; // keep these weapons through the remove trigger
47         spawnfunc_target_items();
48 }
49
50 // weapon give ent from defrag
51 void target_give_init()
52 {
53         entity targ;
54         for (targ = world; (targ = find(targ, targetname, self.target)); ) {
55                 if (targ.classname == "weapon_rocketlauncher") {
56                         self.ammo_rockets += targ.count * cvar("g_balance_rocketlauncher_ammo");
57                         self.netname = "rocketlauncher";
58                 }
59                 else if (targ.classname == "weapon_plasmagun") {
60                         self.ammo_rockets += targ.count * cvar("g_balance_hagar_primary_ammo");
61                         if(self.netname == "")
62                                 self.netname = "hagar";
63                         else
64                                 self.netname = strcat(self.netname, " hagar");
65                 }
66                 else if (targ.classname == "weapon_bfg") {
67                         self.ammo_cells += targ.count * cvar("g_balance_crylink_primary_ammo");
68                         if(self.netname == "")
69                                 self.netname = "crylink";
70                         else
71                                 self.netname = strcat(self.netname, " crylink");
72                 }
73                 else if (targ.classname == "weapon_grenadelauncher") {
74                         self.ammo_rockets += targ.count * cvar("g_balance_grenadelauncher_primary_ammo");
75                         if(self.netname == "")
76                                 self.netname = "grenadelauncher";
77                         else
78                                 self.netname = strcat(self.netname, " grenadelauncher");
79                 }
80                 else if (targ.classname == "item_armor_body")
81                         self.armorvalue = 100;
82                 else if (targ.classname == "item_health_mega")
83                         self.health = 200;
84                 remove(targ);
85         }
86         self.spawnflags = 2;
87         spawnfunc_target_items();
88 }
89
90 void spawnfunc_target_give()
91 {
92         InitializeEntity(self, target_give_init, INITPRIO_FINDTARGET);
93 }
94
95 //void spawnfunc_item_flight()       /* not supported */
96 //void spawnfunc_item_haste()        /* not supported */
97 //void spawnfunc_item_health()       /* handled in t_quake.qc */
98 //void spawnfunc_item_health_large() /* handled in t_items.qc */
99 //void spawnfunc_item_health_small() /* handled in t_items.qc */
100 //void spawnfunc_item_health_mega()  /* handled in t_items.qc */
101 //void spawnfunc_item_invis()        /* not supported */
102 //void spawnfunc_item_regen()        /* not supported */
103 void spawnfunc_team_CTF_redflag()    { spawnfunc_item_flag_team1();    }
104 void spawnfunc_team_CTF_blueflag()   { spawnfunc_item_flag_team2();    }
105 void spawnfunc_team_CTF_redplayer()  { spawnfunc_info_player_team1();  }
106 void spawnfunc_team_CTF_blueplayer() { spawnfunc_info_player_team2();  }
107 void spawnfunc_team_CTF_redspawn()   { spawnfunc_info_player_team1();  }
108 void spawnfunc_team_CTF_bluespawn()  { spawnfunc_info_player_team2();  }
109
110 void spawnfunc_item_flight()         { spawnfunc_item_jetpack();       }