#pragma once #ifdef SVQC #include #endif #include "ammo.qh" #include #ifndef SVQC .int m_itemid; #endif #ifdef GAMEQC MODEL(Jetpack_ITEM, Item_Model("g_jetpack.md3")); #endif #ifdef SVQC bool autocvar_g_powerups_jetpack = true; PROPERTY(int, g_pickup_fuel_jetpack); void powerup_jetpack_init(Pickup def, entity item) { if(!autocvar_g_powerups || !autocvar_g_powerups_jetpack) def.spawnflags |= ITEM_FLAG_MUTATORBLOCKED; if(!GetResource(item, RES_FUEL)) SetResourceExplicit(item, RES_FUEL, g_pickup_fuel_jetpack); } #endif CLASS(Jetpack, Powerup) ENDCLASS(Jetpack) REGISTER_ITEM(Jetpack, Jetpack) { this.m_canonical_spawnfunc = "item_jetpack"; #ifdef GAMEQC this.spawnflags = ITEM_FLAG_NORMAL; this.m_model = MDL_Jetpack_ITEM; this.m_itemid = IT_JETPACK; #endif this.netname = "jetpack"; this.m_name = _("Jetpack"); this.m_icon = "jetpack"; this.m_color = '0.5 0.5 0.5'; this.m_waypoint = _("Jetpack"); this.m_waypointblink = 2; #ifdef SVQC this.m_botvalue = 3000; this.m_pickupevalfunc = ammo_pickupevalfunc; this.m_iteminit = powerup_jetpack_init; #endif } SPAWNFUNC_ITEM(item_jetpack, ITEM_Jetpack) #ifdef GAMEQC MODEL(JetpackFuel_ITEM, Item_Model("g_fuel.md3")); #endif #ifdef SVQC PROPERTY(int, g_pickup_fuel); void ammo_fuel_init(Pickup this, entity item) { if(!GetResource(item, RES_FUEL)) SetResourceExplicit(item, RES_FUEL, g_pickup_fuel); } #endif REGISTER_ITEM(JetpackFuel, Ammo) { this.m_canonical_spawnfunc = "item_fuel"; #ifdef GAMEQC this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; this.m_model = MDL_JetpackFuel_ITEM; #endif this.netname = "fuel"; this.m_name = _("Fuel"); this.m_icon = "ammo_fuel"; #ifdef SVQC this.m_botvalue = 2000; this.m_itemid = IT_RESOURCE; this.m_iteminit = ammo_fuel_init; #endif } SPAWNFUNC_ITEM(item_fuel, ITEM_JetpackFuel) #ifdef GAMEQC MODEL(JetpackRegen_ITEM, Item_Model("g_fuelregen.md3")); #endif #ifdef SVQC bool autocvar_g_powerups_fuelregen = true; void powerup_fuelregen_init(Pickup def, entity item) { if(!autocvar_g_powerups || !autocvar_g_powerups_fuelregen) def.spawnflags |= ITEM_FLAG_MUTATORBLOCKED; } #endif CLASS(JetpackRegen, Powerup) ENDCLASS(JetpackRegen) REGISTER_ITEM(JetpackRegen, JetpackRegen) { this.m_canonical_spawnfunc = "item_fuel_regen"; #ifdef GAMEQC this.spawnflags = ITEM_FLAG_NORMAL; this.m_model = MDL_JetpackRegen_ITEM; #endif this.netname = "fuel_regen"; this.m_name = _("Fuel regenerator"); this.m_icon = "fuelregen"; this.m_color = '1 0.5 0'; this.m_waypoint = _("Fuel regen"); this.m_waypointblink = 2; #ifdef SVQC this.m_botvalue = 3000; this.m_itemid = IT_FUEL_REGEN; this.m_pickupevalfunc = ammo_pickupevalfunc; this.m_iteminit = powerup_fuelregen_init; #endif } SPAWNFUNC_ITEM(item_fuel_regen, ITEM_JetpackRegen)