void() menu_show_error =
{
drawstring('0 200 0', _("ERROR - MENU IS VISIBLE BUT NO MENU WAS DEFINED!"), '8 8 0', '1 0 0', 1, 0);
-};
+}
// CSQC_Init : Called every time the CSQC code is initialized (essentially at map load)
// Useful for precaching things
void() menu_sub_null =
{
-};
+}
#ifdef USE_FTE
float __engine_check;
}
time = savetime;
-};
+}
// Destructor, but does NOT deallocate the entity by calling remove(). Also
// used when an entity changes its type. For an entity that someone interacts
// with others, make sure it can no longer do so.
strunzone(ctf_temp_1);*/
localcmd("\nin_bindmap 0 0;");
-};
+}
void() order_menu_render =
{
} else {
menu_close();
}
-};
+}
float(float bInputType, float nPrimary, float nSecondary) order_menu_action =
{
return FALSE;
}
return TRUE;
-};
+}
void() order_menu_show =
{
order_page = 0;
menu_show = order_menu_render;
menu_action = order_menu_action;
-};
+}
void() ctf_menu_render =
} else {
menu_close();
}
-};
+}
float(float bInputType, float nPrimary, float nSecondary) ctf_menu_action =
{
return FALSE;
}
return TRUE;
-};
+}
void() ctf_menu_show =
{
menu_action = ctf_menu_action;
menu_visible = TRUE;
//menu_default_binds();
-};
+}
void() ctf_view =
{
} else {
drawstring('0 0 0', _("Awaiting orders..."), '8 8 0', '1 1 1', 0.5, 0);
}
-};
+}
#endif
draw_teamradar_player(view_origin, view_angles, '1 1 1');
drawresetcliparea();
-};
+}
// Score (#7)
//
R_PolygonVertex(coord-v_forward, '1 0 0', rgb, panel_fg_alpha);
R_PolygonVertex(coord-v_right*3-v_forward*2, '1 1 0', rgb, panel_fg_alpha);
R_EndPolygon();
-};
+}
void draw_teamradar_icon(vector coord, float icon, entity pingdata, vector rgb, float a)
{
}
// requires that m2>m1 in all coordinates, and that m4>m3
-float boxesoverlap(vector m1, vector m2, vector m3, vector m4) {return m2_x >= m3_x && m1_x <= m4_x && m2_y >= m3_y && m1_y <= m4_y && m2_z >= m3_z && m1_z <= m4_z;};
+float boxesoverlap(vector m1, vector m2, vector m3, vector m4) {return m2_x >= m3_x && m1_x <= m4_x && m2_y >= m3_y && m1_y <= m4_y && m2_z >= m3_z && m1_z <= m4_z;}
// requires the same, but is a stronger condition
-float boxinsidebox(vector smins, vector smaxs, vector bmins, vector bmaxs) {return smins_x >= bmins_x && smaxs_x <= bmaxs_x && smins_y >= bmins_y && smaxs_y <= bmaxs_y && smins_z >= bmins_z && smaxs_z <= bmaxs_z;};
+float boxinsidebox(vector smins, vector smaxs, vector bmins, vector bmaxs) {return smins_x >= bmins_x && smaxs_x <= bmaxs_x && smins_y >= bmins_y && smaxs_y <= bmaxs_y && smins_z >= bmins_z && smaxs_z <= bmaxs_z;}
#ifndef MENUQC
#endif
draw_fontscale = df;
}
}
-};
+}
#endif
e.draw(e);
me.leaveSubitem(me);
}
-};
+}
void Container_focusLeave(entity me)
{
else
me.setFocus(me, front);
SUPER(ModalController).draw(me);
-};
+}
void ModalController_addTab(entity me, entity other, entity tabButton)
{
}
SUPER(Nexposee).draw(me);
-};
+}
float Nexposee_mousePress(entity me, vector pos)
{
float menuNotTheFirstFrame;
float menuMouseMode;
-void SUB_Null() { };
+void SUB_Null() { }
void() m_init =
{
if(Menu_Active)
m_display(); // delayed menu display
-};
+}
void(float key, float ascii) m_keyup =
{
if(key == K_ALT) menuShiftState -= (menuShiftState & S_ALT);
if(key == K_CTRL) menuShiftState -= (menuShiftState & S_CTRL);
if(key == K_SHIFT) menuShiftState -= (menuShiftState & S_SHIFT);
-};
+}
void(float key, float ascii) m_keydown =
{
if(key == K_ALT) menuShiftState |= S_ALT;
if(key == K_CTRL) menuShiftState |= S_CTRL;
if(key == K_SHIFT) menuShiftState |= S_SHIFT;
-};
+}
float SCALEMODE_CROP = 0;
float SCALEMODE_LETTERBOX = 1;
postMenuDraw();
frametime = 0;
-};
+}
void() m_display =
{
main.focusEnter(main);
main.showNotify(main);
-};
+}
void() m_hide =
{
main.focusLeave(main);
main.hideNotify(main);
-};
+}
void() m_toggle =
{
m_hide();
else
m_display();
-};
+}
void() m_shutdown =
{
if(e.destroy)
e.destroy(e);
}
-};
+}
void m_focus_item_chain(entity outermost, entity innermost)
{
// leave a valid one even if it won't reach
findtrajectory_velocity = normalize(end - org) * shotspeed + shotspeedupward * '0 0 1';
return FALSE;
-};
+}
void lag_update()
{
if (self.lag3_time) if (time > self.lag3_time) {self.lag_func(self.lag3_time, self.lag3_float1, self.lag3_float2, self.lag3_entity1, self.lag3_vec1, self.lag3_vec2, self.lag3_vec3, self.lag3_vec4);self.lag3_time = 0;}
if (self.lag4_time) if (time > self.lag4_time) {self.lag_func(self.lag4_time, self.lag4_float1, self.lag4_float2, self.lag4_entity1, self.lag4_vec1, self.lag4_vec2, self.lag4_vec3, self.lag4_vec4);self.lag4_time = 0;}
if (self.lag5_time) if (time > self.lag5_time) {self.lag_func(self.lag5_time, self.lag5_float1, self.lag5_float2, self.lag5_entity1, self.lag5_vec1, self.lag5_vec2, self.lag5_vec3, self.lag5_vec4);self.lag5_time = 0;}
-};
+}
float lag_additem(float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4)
{
if (self.lag5_time == 0) {self.lag5_time = t;self.lag5_float1 = f1;self.lag5_float2 = f2;self.lag5_entity1 = e1;self.lag5_vec1 = v1;self.lag5_vec2 = v2;self.lag5_vec3 = v3;self.lag5_vec4 = v4;return TRUE;}
// no room for it (what is the best thing to do here??)
return FALSE;
-};
+}
float bot_shouldattack(entity e)
{
if(e.flags & FL_NOTARGET)
return FALSE;
return TRUE;
-};
+}
void bot_lagfunc(float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4)
{
self.bot_canfire = (random() < 0.95);
else
self.bot_canfire = 1;
-};
+}
float bot_aimdir(vector v, float maxfiredeviation)
{
//dprint(" diff:", vtos(diffang), "\n");
return self.bot_canfire && (time < self.bot_firetimer);
-};
+}
vector bot_shotlead(vector targorigin, vector targvelocity, float shotspeed, float shotdelay)
{
// Try to add code here that predicts gravity effect here, no clue HOW to though ... well not yet atleast...
return targorigin + targvelocity * (shotdelay + vlen(targorigin - shotorg) / shotspeed);
-};
+}
float bot_aim(float shotspeed, float shotspeedupward, float maxshottime, float applygravity)
{
// return FALSE;
self.dphitcontentsmask = hf;
return TRUE;
-};
+}
self = oldself;
}
return bot;
-};
+}
void bot_think()
{
// now call the current bot AI (havocbot for example)
self.bot_ai();
-};
+}
void bot_setnameandstuff()
{
self.cvar_cl_accuracy_data_share = 1; // share the bots weapon accuracy data with the world
self.cvar_cl_accuracy_data_receive = 0; // don't receive any weapon accuracy data
-};
+}
void bot_custom_weapon_priority_setup()
{
bot_weapons_close[c] = -1;
bot_custom_weapon = TRUE;
-};
+}
void bot_endgame()
{
e = e.nextbot;
}
// if dynamic waypoints are ever implemented, save them here
-};
+}
void bot_relinkplayerlist()
{
dprint(strcat("relink: ", ftos(currentbots), " bots seen.\n"));
bot_strategytoken = bot_list;
bot_strategytoken_taken = TRUE;
-};
+}
void bot_clientdisconnect()
{
JoinBestTeam(self, FALSE, TRUE);
havocbot_setupbot();
-};
+}
void bot_removefromlargestteam()
{
}
currentbots = currentbots - 1;
dropclient(best);
-};
+}
void bot_removenewest()
{
}
currentbots = currentbots - 1;
dropclient(best);
-};
+}
void autoskill(float factor)
{
bot_custom_weapon_priority_setup();
bot_cvar_nextthink = time + 5;
}
-};
+}
}
}
}
-};
+}
void havocbot_keyboard_movement(vector destorg)
{
blend = bound(0,vlen(destorg-self.origin)/autocvar_bot_ai_keyboard_distance,1); // When getting close move with 360 degree
//dprint("movement ", vtos(self.movement), " keyboard ", vtos(keyboard), " blend ", ftos(blend), "\n");
self.movement = self.movement + (keyboard - self.movement) * blend;
-};
+}
void havocbot_bunnyhop(vector dir)
{
}
}
#endif
-};
+}
void havocbot_movetogoal()
{
if ((dir * v_up) >= autocvar_sv_jumpvelocity*0.5 && (self.flags & FL_ONGROUND)) self.BUTTON_JUMP=1;
if (((dodge * v_up) > 0) && random()*frametime >= 0.2*bound(0,(10-skill-self.bot_dodgeskill)*0.1,1)) self.BUTTON_JUMP=TRUE;
if (((dodge * v_up) < 0) && random()*frametime >= 0.5*bound(0,(10-skill-self.bot_dodgeskill)*0.1,1)) self.havocbot_ducktime=time+0.3/bound(0.1,skill+self.bot_dodgeskill,10);
-};
+}
void havocbot_chooseenemy()
{
self.enemy = best;
self.havocbot_stickenemy = TRUE;
-};
+}
float havocbot_chooseweapon_checkreload(float new_weapon)
{
}
}
}
-};
+}
void havocbot_aim()
{
}
else
lag_additem(time + self.ping, 0, 0, world, self.origin, selfvel, ( self.goalcurrent.absmin + self.goalcurrent.absmax ) * 0.5, '0 0 0');
-};
+}
float havocbot_moveto_refresh_route()
{
}
return dodge;
#endif
-};
+}
self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
}
-};
+}
void havocbot_role_ast_defense()
{
self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
}
-};
+}
void havocbot_role_ast_setrole(entity bot, float role)
{
bot.havocbot_role_timeout = 0;
break;
}
-};
+}
void havocbot_ast_reset_role(entity bot)
{
havocbot_role_ast_setrole(bot, HAVOCBOT_AST_ROLE_OFFENSE);
else
havocbot_role_ast_setrole(bot, HAVOCBOT_AST_ROLE_DEFENSE);
-};
+}
void havocbot_chooserole_ast()
{
havocbot_ast_reset_role(self);
-};
+}
f = f.ctf_worldflagnext;
}
return world;
-};
+}
entity havocbot_ctf_find_enemy_flag(entity bot)
{
f = f.ctf_worldflagnext;
}
return world;
-};
+}
float havocbot_ctf_teamcount(entity bot, vector org, float radius)
{
}
return c;
-};
+}
void havocbot_goalrating_ctf_ourflag(float ratingscale)
{
}
if (head)
navigation_routerating(head, ratingscale, 10000);
-};
+}
void havocbot_goalrating_ctf_ourbase(float ratingscale)
{
return;
navigation_routerating(head.basewaypoint, ratingscale, 10000);
-};
+}
void havocbot_goalrating_ctf_enemyflag(float ratingscale)
{
}
if (head)
navigation_routerating(head, ratingscale, 10000);
-};
+}
void havocbot_goalrating_ctf_enemybase(float ratingscale)
{
return;
navigation_routerating(head.basewaypoint, ratingscale, 10000);
-};
+}
void havocbot_goalrating_ctf_ourstolenflag(float ratingscale)
{
if(mf.tag_entity)
navigation_routerating(mf.tag_entity, ratingscale, 10000);
-};
+}
void havocbot_goalrating_ctf_droppedflags(float ratingscale, vector org, float radius)
{
head = head.ctf_worldflagnext;
}
-};
+}
void havocbot_goalrating_ctf_carrieritems(float ratingscale, vector org, float sradius)
{
}
head = head.chain;
}
-};
+}
void havocbot_role_ctf_setrole(entity bot, float role)
{
break;
}
dprint("\n");
-};
+}
void havocbot_role_ctf_carrier()
{
return;
}
}
-};
+}
void havocbot_role_ctf_escort()
{
havocbot_goalrating_items(10000, self.origin, 10000);
navigation_goalrating_end();
}
-};
+}
void havocbot_role_ctf_offense()
{
havocbot_goalrating_items(1000, self.origin, 10000);
navigation_goalrating_end();
}
-};
+}
// Retriever (temporary role):
void havocbot_role_ctf_retriever()
havocbot_goalrating_items(500, self.origin, radius);
navigation_goalrating_end();
}
-};
+}
void havocbot_role_ctf_middle()
{
havocbot_goalrating_ctf_enemybase(2500);
navigation_goalrating_end();
}
-};
+}
void havocbot_role_ctf_defense()
{
havocbot_goalrating_items(5000, self.origin, 10000);
navigation_goalrating_end();
}
-};
+}
void havocbot_calculate_middlepoint()
{
}
havocbot_ctf_middlepoint = p1 + ((p2-p1) * 0.5);
havocbot_ctf_middlepoint_radius = vlen(p2-p1) * 0.5;
-};
+}
void havocbot_ctf_reset_role(entity bot)
{
havocbot_role_ctf_setrole(bot, HAVOCBOT_CTF_ROLE_OFFENSE);
else
havocbot_role_ctf_setrole(bot, HAVOCBOT_CTF_ROLE_MIDDLE);
-};
+}
void havocbot_chooserole_ctf()
{
havocbot_ctf_reset_role(self);
-};
+}
}
}
}
-};
+}
void havocbot_role_ft_offense()
{
//havocbot_goalrating_waypoints(1, self.origin, 1000);
navigation_goalrating_end();
}
-};
+}
void havocbot_role_ft_freeing()
{
//havocbot_goalrating_waypoints(1, self.origin, 1000);
navigation_goalrating_end();
}
-};
+}
void havocbot_chooserole_ft()
{
self.havocbot_role = havocbot_role_ft_freeing;
else
self.havocbot_role = havocbot_role_ft_offense;
-};
+}
// Ball has been dropped so collect.
navigation_routerating(ka_ball, ratingscale, 2000);
-};
+}
void havocbot_role_ka_carrier()
{
self.havocbot_role = havocbot_role_ka_collector;
self.bot_strategytime = 0;
}
-};
+}
void havocbot_role_ka_collector()
{
self.havocbot_role = havocbot_role_ka_carrier;
self.bot_strategytime = 0;
}
-};
+}
void havocbot_chooserole_ka()
{
self.havocbot_role = havocbot_role_ka_carrier;
else
self.havocbot_role = havocbot_role_ka_collector;
-};
+}
}
havocbot_goalrating_items(1, self.origin, 10000);
-};
+}
void havocbot_role_kh_carrier()
{
navigation_goalrating_end();
}
-};
+}
void havocbot_role_kh_offense()
{
navigation_goalrating_end();
}
-};
+}
void havocbot_role_kh_freelancer()
{
navigation_goalrating_end();
}
-};
+}
void havocbot_chooserole_kh()
{
self.havocbot_role = havocbot_role_kh_defense;
else
self.havocbot_role = havocbot_role_kh_freelancer;
-};
+}
}
head = head.chain;
}
-};
+}
void havocbot_role_ons_setrole(entity bot, float role)
{
break;
}
dprint("\n");
-};
+}
float havocbot_ons_teamcount(entity bot, float role)
{
++c;
return c;
-};
+}
void havocbot_goalrating_ons_controlpoints_attack(float ratingscale)
{
if not(found)
navigation_routerating(cp, ratingscale, 10000);
}
-};
+}
float havocbot_goalrating_ons_generator_attack(float ratingscale)
{
}
}
return FALSE;
-};
+}
void havocbot_role_ons_offense()
{
self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
}
-};
+}
void havocbot_role_ons_assistant()
{
havocbot_ons_reset_role(self);
-};
+}
void havocbot_role_ons_defense()
{
havocbot_ons_reset_role(self);
-};
+}
void havocbot_ons_reset_role(entity bot)
{
}
havocbot_role_ons_setrole(bot, HAVOCBOT_ONS_ROLE_OFFENSE);
-};
+}
void havocbot_chooserole_ons()
{
havocbot_ons_reset_role(self);
-};
+}
navigation_routerating(head, rating * ratingscale, 2000);
head = head.chain;
}
-};
+}
void havocbot_goalrating_controlpoints(float ratingscale, vector org, float sradius)
{
}
head = head.chain;
}
-};
+}
void havocbot_goalrating_enemyplayers(float ratingscale, vector org, float sradius)
{
navigation_routerating(head, t * ratingscale, 2000);
}
}
-};
+}
// choose a role according to the situation
void() havocbot_role_dm;
//havocbot_goalrating_waypoints(1, self.origin, 1000);
navigation_goalrating_end();
}
-};
+}
//DM:
//go to best items
//havocbot_goalrating_waypoints(1, self.origin, 1000);
navigation_goalrating_end();
}
-};
+}
//Race:
//go to next checkpoint, and annoy enemies
navigation_goalrating_end();
}
-};
+}
void havocbot_chooserole_dm()
{
self.havocbot_role = havocbot_role_dm;
-};
+}
void havocbot_chooserole_race()
{
self.havocbot_role = havocbot_role_race;
-};
+}
void havocbot_chooserole_dom()
{
self.havocbot_role = havocbot_role_dom;
-};
+}
void havocbot_chooserole()
{
havocbot_chooserole_ast();
else // assume anything else is deathmatch
havocbot_chooserole_dm();
-};
+}
debugnodestatus(org, DEBUG_NODE_FAIL);
return FALSE;
-};
+}
/////////////////////////////////////////////////////////////////////////////
// goal stack
self.goalstack29 = world;
self.goalstack30 = world;
self.goalstack31 = world;
-};
+}
// add a new goal at the beginning of the stack
// (in other words: add a new prerequisite before going to the later goals)
self.goalstack02 = self.goalstack01;
self.goalstack01 = self.goalcurrent;
self.goalcurrent = e;
-};
+}
// remove first goal from stack
// (in other words: remove a prerequisite for reaching the later goals)
self.goalstack29 = self.goalstack30;
self.goalstack30 = self.goalstack31;
self.goalstack31 = world;
-};
+}
// find the spawnfunc_waypoint near a dynamic goal such as a dropped weapon
entity navigation_findnearestwaypoint(entity ent, float walkfromwp)
wp.wpfire = 1;
wp.wpnearestpoint = v;
}
-};
+}
// queries the entire spawnfunc_waypoint network for pathes leading away from the bot
void navigation_markroutes(entity fixed_source_waypoint)
w = w.chain;
}
}
-};
+}
// queries the entire spawnfunc_waypoint network for pathes leading to the bot
void navigation_markroutes_inverted(entity fixed_source_waypoint)
w = w.chain;
}
}
-};
+}
// updates the best goal according to a weighted calculation of travel cost and item value of a new proposed item
void navigation_routerating(entity e, float f, float rangebias)
}
}
//dprint("\n");
-};
+}
// adds an item to the the goal stack with the path to a given item
float navigation_routetogoal(entity e, vector startposition)
}
return FALSE;
-};
+}
// removes any currently touching waypoints from the goal stack
// (this is how bots detect if they reached a goal)
navigation_clearroute();
navigation_bestgoal = world;
navigation_markroutes(world);
-};
+}
// ends a goal selection session (updates goal stack to the best goal)
void navigation_goalrating_end()
self.navigation_hasgoals = FALSE; // Reset this value
}
-};
+}
void botframe_updatedangerousobjects(float maxupdate)
{
break;
botframe_dangerwaypoint = find(botframe_dangerwaypoint, classname, "waypoint");
}
-};
+}
void navigation_unstuck()
{
w.model = "";
return w;
-};
+}
// add a new link to the spawnfunc_waypoint, replacing the furthest link it already has
void waypoint_addlink(entity from, entity to)
if (from.wp01mincost < c) {from.wp02 = to;from.wp02mincost = c;return;} from.wp02 = from.wp01;from.wp02mincost = from.wp01mincost;
if (from.wp00mincost < c) {from.wp01 = to;from.wp01mincost = c;return;} from.wp01 = from.wp00;from.wp01mincost = from.wp00mincost;
from.wp00 = to;from.wp00mincost = c;return;
-};
+}
// relink this spawnfunc_waypoint
// (precompile a list of all reachable waypoints from this spawnfunc_waypoint)
}
navigation_testtracewalk = 0;
self.wplinked = TRUE;
-};
+}
void waypoint_clearlinks(entity wp)
{
wp.wp24mincost = wp.wp25mincost = wp.wp26mincost = wp.wp27mincost = wp.wp28mincost = wp.wp29mincost = wp.wp30mincost = wp.wp31mincost = f;
wp.wplinked = FALSE;
-};
+}
// tell a spawnfunc_waypoint to relink
void waypoint_schedulerelink(entity wp)
// schedule a relink after other waypoints have had a chance to spawn
waypoint_clearlinks(self);
//waypoint_schedulerelink(self);
-};
+}
// remove a spawnfunc_waypoint, and schedule all neighbors to relink
void waypoint_remove(entity e)
waypoint_schedulerelink(e.wp31);
// and now remove the spawnfunc_waypoint
remove(e);
-};
+}
// empties the map of waypoints
void waypoint_removeall()
remove(head);
head = next;
}
-};
+}
// tell all waypoints to relink
// (is this useful at all?)
waypoint_schedulerelink(head);
head = head.chain;
}
-};
+}
// Load waypoint links from file
float waypoint_load_links()
botframe_cachedwaypointlinks = TRUE;
return TRUE;
-};
+}
void waypoint_load_links_hardwired()
{
dprint(" waypoint links from maps/");
dprint(mapname);
dprint(".waypoints.hardwired\n");
-};
+}
// Save all waypoint links to a file
void waypoint_save_links()
print(" waypoints links to maps/");
print(mapname);
print(".waypoints.cache\n");
-};
+}
// save waypoints to gamedir/data/maps/mapname.waypoints
void waypoint_saveall()
}
waypoint_save_links();
botframe_loadedforcedlinks = FALSE;
-};
+}
// load waypoints from file
float waypoint_loadall()
dprint(" failed\n");
}
return cwp + cwb;
-};
+}
vector waypoint_fixorigin(vector position)
{
return;
waypoint_spawnforitem_force(e, e.origin);
-};
+}
void waypoint_spawnforteleporter_boxes(entity e, vector org1, vector org2, vector destination1, vector destination2, float timetaken)
{
// (teleporters are not goals, so this is probably useless)
e.nearestwaypoint = w;
e.nearestwaypointtimeout = time + 1000000000;
-};
+}
void waypoint_spawnforteleporter_v(entity e, vector org, vector destination, float timetaken)
{
org = waypoint_fixorigin(org);
destination = waypoint_fixorigin(destination);
waypoint_spawnforteleporter_boxes(e, org, org, destination, destination, timetaken);
-};
+}
void waypoint_spawnforteleporter(entity e, vector destination, float timetaken)
{
destination = waypoint_fixorigin(destination);
waypoint_spawnforteleporter_boxes(e, e.absmin, e.absmax, destination, destination, timetaken);
-};
+}
entity waypoint_spawnpersonal(vector position)
{
waypoint_schedulerelink(w);
return w;
-};
+}
void botframe_showwaypointlinks()
{
}
player = find(player, classname, "player");
}
-};
+}
self.team = activator.team;
some_spawn_has_been_used = 1;
}
-};
+}
// Returns:
// _x: prio (-1 if unusable)
self.model = self.mdl;
else
self.model = "";
-};
+}
void UpdateChatBubble()
{
else if (c == 12) self.colormod = '1.22 1.22 0.10';
else if (c == 13) self.colormod = '0.10 0.10 1.73';
else self.colormod = '1 1 1';
-};*/
+}*/
.float oldcolormap;
void respawn(void)
return;
}
}
-};
+}
void CheckPlayerJump()
{
if(self.flags & FL_ONGROUND)
self.lastflags = self.flags;
self.lastclassname = self.classname;
-};
+}
// TODO introspect models for finding right "fps" value (1/duration)
// reset animstate now
setanim(self, self.anim_idle, TRUE, FALSE, TRUE);
-};
+}
void player_anim (void)
{
{
W_TriggerReload();
}
-};
+}
.float weaponcomplainindex;
float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, float complain, float skipmissing)
float w_getbestweapon(entity e)
{
return W_GetCycleWeapon(e, e.cvar_cl_weaponpriority, 0, -1, FALSE, TRUE);
-};
+}
// generic weapons table
// TODO should they be macros instead?
float weapon_action(float wpn, float wrequest)
{
return (get_weaponinfo(wpn)).weapon_func(wrequest);
-};
+}
string W_Name(float weaponid)
{
sprint(self, strcat("You dropped the ^2", W_Name(w), "\n"));
else
sprint(self, strcat("You dropped the ^2", W_Name(w), " with ", a, "\n"));
-};
+}
// Bringed back weapon frame
void W_WeaponFrame()
else
self.currentammo = 1;
#endif
-};
+}
// nudge w_shotend so a trace to w_shotend hits
w_shotend = w_shotend + normalize(w_shotend - w_shotorg) * nudge;
-};
+}
#define W_SetupShot_Dir_ProjectileSize(ent,s_forward,mi,ma,antilag,recoil,snd,chan,maxdamage) W_SetupShot_Dir_ProjectileSize_Range(ent, s_forward, mi, ma, antilag, recoil, snd, chan, maxdamage, MAX_SHOT_DISTANCE)
#define W_SetupShot_ProjectileSize(ent,mi,ma,antilag,recoil,snd,chan,maxdamage) W_SetupShot_Dir_ProjectileSize(ent, v_forward, mi, ma, antilag, recoil, snd, chan, maxdamage)
f = 1;
self.angles_x = -90 * f * f;
}
-};
+}
void CL_ExteriorWeaponentity_Think()
{
self.glowmod = self.owner.weaponentity_glowmod;
self.colormap = self.owner.colormap;
-};
+}
// spawning weaponentity for client
void CL_SpawnWeaponentity()
self.exteriorweaponentity.angles = '0 0 0';
self.exteriorweaponentity.think = CL_ExteriorWeaponentity_Think;
self.exteriorweaponentity.nextthink = time;
-};
+}
void Send_WeaponComplain (entity e, float wpn, string wpnname, float type)
{
play2(cl, "weapons/unavailable.wav");
}
return FALSE;
-};
+}
// Weapon subs
void w_clear()
self.weaponentity.state = WS_CLEAR;
self.weaponentity.effects = 0;
}
-};
+}
void w_ready()
{
if (self.weaponentity)
self.weaponentity.state = WS_READY;
weapon_thinkf(WFRAME_IDLE, 1000000, w_ready);
-};
+}
// Setup weapon for client (after this raise frame will be launched)
void weapon_setup(float windex)
self.switchingweapon = windex; // to make sure
self.weaponname = e.mdl;
self.bulletcounter = 0;
-};
+}
// perform weapon to attack (weaponstate and attack_finished check is here)
void W_SwitchToOtherWeapon(entity pl)
setanim(self, anim, FALSE, TRUE, TRUE);
}
}
-};
+}
void weapon_boblayer1(float spd, vector org)
{
// VorteX: haste can be added here
-};
+}
vector W_CalculateProjectileVelocity(vector pvelocity, vector mvelocity, float forceAbsolute)
{
}
InitializeEntity(self, ctf_flag_spawnstuff, INITPRIO_SETLOCATION);
-};
+}
void LogCTF(string mode, float flagteam, entity actor)
{
e.cnt = FLAG_BASE;
e.owner = world;
e.flags = FL_ITEM | FL_NOTARGET; // clear FL_ONGROUND and any other junk
-};
+}
void ReturnFlag(entity e)
{
}
e.owner = world;
RegenFlag(e);
-};
+}
void DropFlag(entity e, entity penalty_receiver, entity attacker)
{
tracebox(e.origin, e.mins, e.maxs, e.origin, TRUE, e);
if(trace_startsolid)
dprint("FLAG FALLTHROUGH will happen SOON\n");
-};
+}
void FlagThink()
{
DropFlag(self, world, world);
return;
}
-};
+}
float ctf_usekey()
{
void flag_cap_ring_spawn(vector org)
{
shockwave_spawn("models/ctf/shockwavetransring.md3", org - '0 0 15', -0.8, 0, 1);
-};
+}
void FlagTouch()
{
WaypointSprite_AttachCarrier("flagcarrier", other, RADARICON_FLAGCARRIER, '1 1 0');
}
}
-};
+}
/*QUAKED spawnfunc_info_player_team1 (1 0 0) (-16 -16 -24) (16 16 24)
CTF Starting point for a player
}
self.team = COLOR_TEAM1; // red
spawnfunc_info_player_deathmatch();
-};
-//self.team = 4;self.classname = "info_player_start";spawnfunc_info_player_start();};
+}
+//self.team = 4;self.classname = "info_player_start";spawnfunc_info_player_start();}
/*QUAKED spawnfunc_info_player_team2 (1 0 0) (-16 -16 -24) (16 16 24)
CTF Starting point for a player in
}
self.team = COLOR_TEAM2; // blue
spawnfunc_info_player_deathmatch();
-};
-//self.team = 13;self.classname = "info_player_start";spawnfunc_info_player_start();};
+}
+//self.team = 13;self.classname = "info_player_start";spawnfunc_info_player_start();}
/*QUAKED spawnfunc_info_player_team3 (1 0 0) (-16 -16 -24) (16 16 24)
CTF Starting point for a player in
}
self.team = COLOR_TEAM3; // yellow
spawnfunc_info_player_deathmatch();
-};
+}
/*QUAKED spawnfunc_info_player_team4 (1 0 0) (-16 -16 -24) (16 16 24)
}
self.team = COLOR_TEAM4; // purple
spawnfunc_info_player_deathmatch();
-};
+}
void item_flag_reset()
{
self.glow_size = 25;
self.glow_trail = 1;
}
-};
+}
/*QUAKED spawnfunc_item_flag_team1 (0 0.5 0.8) (-48 -48 -37) (48 48 37)
CTF flag for team one (Red).
precache_model("models/ctf/shockwavetransring.md3");
self.reset = item_flag_reset;
-};
+}
/*QUAKED spawnfunc_item_flag_team2 (0 0.5 0.8) (-48 -48 -24) (48 48 64)
CTF flag for team two (Blue).
precache_model("models/ctf/shockwavetransring.md3");
self.reset = item_flag_reset;
-};
+}
/*QUAKED spawnfunc_ctf_team (0 .5 .8) (-16 -16 -24) (16 16 32)
}
self.classname = "ctf_team";
self.team = self.cnt + 1;
-};
+}
// code from here on is just to support maps that don't have control point and team entities
void ctf_spawnteam (string teamname, float teamcolor)
spawnfunc_ctf_team();
self = oldself;
-};
+}
// spawn some default teams if the map is not set up for ctf
void ctf_spawnteams()
ctf_spawnteam("Red", COLOR_TEAM1 - 1);
ctf_spawnteam("Blue", COLOR_TEAM2 - 1);
-};
+}
void ctf_delayedinit()
{
ctf_spawnteams();
ScoreRules_ctf();
-};
+}
void ctf_init()
{
//#NO AUTOCVARS START
g_ctf_win_mode = cvar("g_ctf_win_mode");
//#NO AUTOCVARS END
-};
+}
void ctf_setstatus2(entity flag, float shift)
{
{
// no status bits
}
-};
+}
void ctf_setstatus()
{
ctf_setstatus2(flag, IT_BLUE_FLAG_TAKEN);
}
}
-};
+}
/*
entity(float cteam) ctf_team_has_commander =
{
}
}
return world;
-};
+}
void(entity e, float st) ctf_setstate =
{
e.ctf_state = st;
++e.version;
-};
+}
void(float cteam) ctf_new_commander =
{
ctf_setstate(plmax, 3);
sprint(plmax, "^3You're the commander now!\n");
centerprint(plmax, "^3You're the commander now!\n");
-};
+}
void() ctf_clientconnect =
{
if(self.team != 0 && self.classname == "player" && !ctf_team_has_commander(self.team)) {
ctf_new_commander(self.team);
}
-};
+}
void() ctf_playerchanged =
{
self.team_saved = self.team;
ctf_new_commander(self.team);
-};
+}
void() ctf_clientdisconnect =
{
{
ctf_new_commander(self.team);
}
-};
+}
entity GetPlayer(string);
float() ctf_clientcommand =
return TRUE;
}
return FALSE;
-};
+}
*/
FOR_EACH_REALCLIENT(head)
set_dom_state(head);
-};
+}
void AnimateDomPoint()
{
self.enemy = other; // individual player scoring
self.enemy_playerid = other.playerid;
dompoint_captured();
-};
+}
/*QUAKED spawnfunc_dom_team (0 .5 .8) (-32 -32 -24) (32 32 32)
Team declaration for Domination gameplay, this allows you to decide what team
// this would have to be changed if used in quakeworld
if(self.cnt)
self.team = self.cnt + 1; // WHY are these different anyway?
-};
+}
void dom_controlpoint_setup()
{
waypoint_spawnforitem(self);
WaypointSprite_SpawnFixed("dom-neut", self.origin + '0 0 32', self, sprite, RADARICON_DOMPOINT, '0 1 1');
-};
+}
self.effects = self.effects | EF_LOWPRECISION;
if (autocvar_g_domination_point_fullbright)
self.effects |= EF_FULLBRIGHT;
-};
+}
// code from here on is just to support maps that don't have control point and team entities
void dom_spawnteam (string teamname, float teamcolor, string pointmodel, float pointskin, string capsound, string capnarration, string capmessage)
//eprint(self);
self = oldself;
-};
+}
void dom_spawnpoint(vector org)
{
setorigin(self, org);
spawnfunc_dom_controlpoint();
self = oldself;
-};
+}
// spawn some default teams if the map is not set up for domination
void dom_spawnteams()
if(numteams > 3)
dom_spawnteam("Pink", COLOR_TEAM4-1, "models/domination/dom_pink.md3", 0, "domination/claim.wav", "", "Pink team has captured a control point");
dom_spawnteam("", 0, "models/domination/dom_unclaimed.md3", 0, "", "", "");
-};
+}
void dom_delayedinit()
{
}
ScoreRules_dom();
-};
+}
void dom_init()
{
addstat(STAT_DOM_PPS_BLUE, AS_FLOAT, dom_pps_blue);
if(c3 >= 0) addstat(STAT_DOM_PPS_YELLOW, AS_FLOAT, dom_pps_yellow);
if(c4 >= 0) addstat(STAT_DOM_PPS_PINK, AS_FLOAT, dom_pps_pink);
-};
+}
void entcs_init()
{
print("Initializing ClientSide information entities\n");
-};
+}
float entcs_customize()
{
if(sf & 16)
WriteByte(MSG_ENTITY, self.armorvalue / 10); // FIXME use a better scale?
return TRUE;
-};
+}
void entcs_think()
{
self.armorvalue = o.armorvalue;
self.SendFlags |= 16;
}
-};
+}
entity attach_entcs()
{
self.entcs = ent;
return ent;
-};
+}
void detach_entcs()
{
remove(self.entcs);
self.entcs = world;
-};
+}
//it is a good idea to return FALSE early in the function if possible to reduce cpu usage, because this function may be called many thousands of times per frame if there are many customized entities on a 64+ player server.
//you are free to change anything in self, but please do not change any other entities (the results may be very inconsistent).
//example ideas for use of this extension:
-//making icons over teammates' heads which are only visible to teammates. for exasmple: float() playericon_customizeentityforclient = {return self.owner.team == other.team;};
-//making cloaked players more visible to their teammates than their enemies. for example: float() player_customizeentityforclient = {if (self.items & IT_CLOAKING) {if (self.team == other.team) self.alpha = 0.6;else self.alpha = 0.1;} return TRUE;};
-//making explosion models that face the viewer (does not work well with chase_active). for example: float() explosion_customizeentityforclient = {self.angles = vectoangles(other.origin + other.view_ofs - self.origin);self.angles_x = 0 - self.angles_x;};
+//making icons over teammates' heads which are only visible to teammates. for exasmple: float() playericon_customizeentityforclient = {return self.owner.team == other.team;}
+//making cloaked players more visible to their teammates than their enemies. for example: float() player_customizeentityforclient = {if (self.items & IT_CLOAKING) {if (self.team == other.team) self.alpha = 0.6;else self.alpha = 0.1;} return TRUE;}
+//making explosion models that face the viewer (does not work well with chase_active). for example: float() explosion_customizeentityforclient = {self.angles = vectoangles(other.origin + other.view_ofs - self.origin);self.angles_x = 0 - self.angles_x;}
//implementation notes:
//entity customization is done before per-client culling (visibility for instance) because the entity may be doing setorigin to display itself in different locations on different clients, may be altering its .modelindex, .effects and other fields important to culling, so customized entities increase cpu usage (non-customized entities can use all the early culling they want however, as they are not changing on a per client basis).
bonenum = skel_get_boneparent(skel, bonenum);
}
return 0;
-};
+}
// create a skeletonindex for our player using current modelindex
void() example_skel_player_setup =
{
self.skeletonindex = skel_create(self.modelindex);
-};
+}
// setup bones of skeleton based on an animation
// note: animmodelindex can be a different model than self.modelindex
void(float animmodelindex, float framegroup, float framegroupstarttime) example_skel_player_update_begin =
self.lerpfrac3 = 0;
self.lerpfrac4 = 0;
skel_build(self.skeletonindex, self, animmodelindex, 0, 0, 100000);
-};
+}
// apply a different framegroup animation to bones with a specified parent
void(float animmodelindex, float framegroup, float framegroupstarttime, float blendalpha, string groupbonename, string excludegroupname1, string excludegroupname2) example_skel_player_update_applyoverride =
{
skel_build(self.skeletonindex, self, animmodelindex, 1 - blendalpha, bonenum, bonenum + 1);
bonenum = bonenum + 1;
}
-};
+}
// make eyes point at a target location, be sure v_forward, v_right, v_up are set correctly before calling
void(vector eyetarget, string bonename) example_skel_player_update_eyetarget =
{
v_forward = oldforward;
v_right = oldright;
v_up = oldup;
-};
+}
// delete skeleton when we're done with it
// note: skeleton remains valid until next frame when it is really deleted
void() example_skel_player_delete =
{
skel_delete(self.skeletonindex);
self.skeletonindex = 0;
-};
+}
//
// END OF EXAMPLES FOR FTE_CSQC_SKELETONOBJECTS
//
if(dbr.damageforcescale)
dbr.takedamage = DAMAGE_YES;
SUB_SetFade(dbr, time + self.debristime + crandom() * self.debristimejitter, self.debrisfadetime);
-};
+}
void func_breakable_colormod()
{
remove(self);
self.nextthink = time + 0.1;
-};
+}
void dynlight_find_aiment()
{
entity targ;
self.v_angle = self.angles - targ.angles;
self.think = dynlight_think;
self.nextthink = time + 0.1;
-};
+}
void dynlight_find_path()
{
entity targ;
setorigin (self, targ.origin);
self.think = train_next;
self.nextthink = time + 0.1;
-};
+}
void dynlight_find_target()
{
entity targ;
self.light_lev = self.lefty;
else
self.light_lev = 0;
-};
+}
void spawnfunc_dynlight()
{
local entity targ;
InitializeEntity(self, dynlight_find_path, INITPRIO_FINDTARGET);
return;
}
-};
+}
-void SUB_Null() {};
+void SUB_Null() {}
float SUB_True() { return 1; }
float SUB_False() { return 0; }
e.animstate_override = override;
e.frame = e.animstate_startframe;
e.frame1time = servertime;
-};
+}
void updateanim(entity e)
{
}
e.frame = e.animstate_startframe + bound(0, (time - e.animstate_starttime) * e.animstate_framerate, e.animstate_numframes - 1);
//print(ftos(time), " -> ", ftos(e.frame), "\n");
-};
+}
vector animfixfps(entity e, vector a)
{
}
self.angles = '0 0 0';
-};
+}
void InitTrigger()
{
self.movetype = MOVETYPE_NONE;
self.modelindex = 0;
self.model = "";
-};
+}
void InitSolidBSPTrigger()
{
self.movetype = MOVETYPE_NONE; // why was this PUSH? -div0
// self.modelindex = 0;
self.model = "";
-};
+}
float InitMovingBrushTrigger()
{
return 0;
}
return 1;
-};
+}
float Tetris_Level()
{
return ((floor((self.tet_lines / 10)) + 1));
-};
+}
void tetsnd(string snd)
{
if(ln < 1 || ln > TET_LINES)
error("WTF");
bufstr_set(tet_line_buf, ln + TET_LINES * num_for_edict(self), vl);
-};
+}
string GetLine(float ln)
{
if(ln < 1 || ln > TET_LINES)
return TET_EMPTY_LINE;
return bufstr_get(tet_line_buf, ln + TET_LINES * num_for_edict(self));
-};
+}
float GetXBlock(float x, string dat)
{
if(x < 1 || x > TET_WIDTH)
error("WTF");
return stof(substring(dat, x-1, 1));
-};
+}
string SetXBlock(float x, string dat, float new)
{
ftos(new),
substring(dat, x, -1)
);
-};
+}
float GetSquare(float x, float y)
{
return GetXBlock(x, GetLine(y));
-};
+}
void SetSquare(float x, float y, float val)
{
dat = GetLine(y);
dat = SetXBlock(x, dat, val);
SetLine(y, dat);
-};
+}
float PieceColor(float pc)
{
return !!(ce_y & pow(4, x-1)); // second row
else
return 0; // illegal parms
-};
+}
vector tet_piecemins;
vector tet_piecemaxs;
void PieceMinsMaxs(float rot, float pc)
}
WriteChar(MSG_ONE, 176 + num);
return dig;
-};
+}
void DrawLine(float ln)
{
self.piece_type = 0;
self.next_piece = self.tet_lines = self.tet_score = 0;
self.tet_piece_bucket = 0;
-};
+}
void Tet_GameExit()
{
self.tet_vs_id = 0;
ResetTetris();
self.movetype = MOVETYPE_WALK;
-};
+}
void PrintField()
{
self.tet_piece_bucket = b;
return p + 1;
}
-};
+}
void TetAddScore(float n)
{
self.tet_score = self.tet_score + n * Tetris_Level();
if (self.tet_score > tet_high_score)
tet_high_score = self.tet_score;
-};
+}
float CheckMetrics(float piece, float orgx, float orgy, float rot) /*FIXDECL*/
{
// check to see if the piece, if moved to the locations will overlap
tetsnd("tetline");
else
tetsnd("tetland");
-};
+}
void HandleGame(float keyss)
{
return;
}
CementPiece(self.piece_type, self.piece_pos_x, self.piece_pos_y, self.piece_pos_z);
-};
+}
/*
*********************************
Tet_GameExit();
self.impulse = 0;
}
-};
+}
float TetrisPreFrame()
else
self.tet_drawtime = time + 0.5;
return 1;
-};
+}
float frik_anglemoda(float v)
{
return v - floor(v/360) * 360;
-};
+}
float angcompa(float y1, float y2)
{
y1 = frik_anglemoda(y1);
else if (answer < -180)
answer = answer + 360;
return answer;
-};
+}
.float tetkey_down, tetkey_rotright, tetkey_left, tetkey_right, tetkey_rotleft, tetkey_drop;
}
return 1;
-};
+}
#else
activator = self.enemy;
SUB_UseTargets ();
remove(self);
-};
+}
/*
==============================
activator = act;
self = stemp;
other = otemp;
-};
+}
//=============================================================================
self.takedamage = DAMAGE_YES;
self.solid = SOLID_BBOX;
}
-};
+}
// the trigger was just touched/killed/used
// called wheil C code is looping through area links...
self.touch = SUB_Null;
}
-};
+}
void multi_use()
{
self.goalentity = other;
self.enemy = activator;
multi_trigger();
-};
+}
void multi_touch()
{
self.enemy = other;
self.goalentity = other;
multi_trigger ();
-};
+}
void multi_eventdamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
setorigin (self, self.origin); // make sure it links into the world
}
}
-};
+}
/*QUAKED spawnfunc_trigger_once (.5 .5 .5) ? notouch
{
self.wait = -1;
spawnfunc_trigger_multiple();
-};
+}
//=============================================================================
{
self.use = SUB_UseTargets;
self.reset = spawnfunc_trigger_relay; // this spawnfunc resets fully
-};
+}
void delay_use()
{
centerprint(activator, "Sequence completed!");
self.enemy = activator;
multi_trigger ();
-};
+}
void counter_reset()
{
self.use = counter_use;
self.reset = counter_reset;
-};
+}
void trigger_hurt_use()
{
}
return;
-};
+}
/*QUAKED spawnfunc_trigger_hurt (.5 .5 .5) ?
Any object touching this will be hurt
if(trigger_hurt_last)
trigger_hurt_last.trigger_hurt_next = self;
trigger_hurt_last = self;
-};
+}
float tracebox_hits_trigger_hurt(vector start, vector mi, vector ma, vector end)
{
}
}
}
-};
+}
void spawnfunc_trigger_heal()
{
if(self.noise == "")
self.noise = "misc/mediumhealth.wav";
precache_sound(self.noise);
-};
+}
//////////////////////////////////////////////////////////////
self.count -= 1;
self.nextthink = time;
}
-};
+}
void trigger_gravity_use()
{
self.state = !self.state;
-};
+}
void trigger_gravity_touch()
{
sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
UpdateCSQCProjectile(self.owner);
}
-};
+}
void spawnfunc_trigger_gravity()
{
if(self.spawnflags & 2)
self.state = FALSE;
}
-};
+}
//=============================================================================
ambientsound (self.origin, self.noise, VOL_BASE * self.volume, self.atten);
remove(self);
}
-};
+}
void spawnfunc_func_stardust() {
WriteShort(MSG_ENTITY, self.count);
WriteByte(MSG_ENTITY, self.cnt);
return 1;
-};
+}
/*QUAKED spawnfunc_func_rain (0 .5 .8) ?
This is an invisible area like a trigger, which rain falls inside of.
self.Version = 1;
Net_LinkEntity(self, FALSE, 0, rainsnow_SendEntity);
-};
+}
/*QUAKED spawnfunc_func_snow (0 .5 .8) ?
self.Version = 1;
Net_LinkEntity(self, FALSE, 0, rainsnow_SendEntity);
-};
+}
void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, float deathtype);
localcmd("endmatch\n");
else
localcmd(strcat("changelevel ", self.chmap, "\n"));
-};
+}
void spawnfunc_target_changelevel()
{
self.use = spawnfunc_target_changelevel_use;
-};
+}
{
// settings persist, except...
localcmd("\nsettemp_restore\n");
-};
+}
void Map_Goto()
{
}
return "";
-};
+}
float DoNextMapOverride()
{
return TRUE;
}
return FALSE;
-};
+}
void GotoNextMap()
{
}
Map_Goto();
}
-};
+}
/*
return;
MapVote_Start();
-};
+}
/*
============
//objerror ("FindIntermission: no spot");
return world;
-};
+}
*/
/*
// fixme: don't check players; instead check spawnfunc_dom_team and spawnfunc_ctf_team entities
// (div0: and that in CheckRules_World please)
-};
+}
float checkrules_equality;
float checkrules_suddendeathwarning;
//print("WINNING\n");
NextLevel();
}
-};
+}
float mapvote_nextthink;
float mapvote_initialized;
}
MapVote_Tick();
-};
+}
string GotoMap(string m)
{
else
{
// close the file
- fputs(self.cnt, "};\n");
+ fputs(self.cnt, "}\n");
fclose(self.cnt);
print("Finished. Please edit data/", self.netname, " with an image editing application and place it in the TGA format in the gfx folder.\n");
RadarMap_Next();
self.classname = "target_location";
// location name in netname
// eventually support: count, teamgame selectors, line of sight?
-};
+}
void spawnfunc_info_location()
{
self.classname = "target_location";
self.message = self.netname;
-};
+}
string NearestLocation(vector p)
{
v_y = m2_y * random() + m1_y;
v_z = m2_z * random() + m1_z;
return v;
-};
+}
//#NO AUTOCVARS START
if(d>2)
if(random()<0.6)
pointparticles(particleeffectnum("onslaught_generator_gib_flame"), self.origin, '0 0 0', 1);
-};
+}
void ons_throwgib(vector v_from, vector v_to, string smodel, float f_lifetime, float b_burn)
{
}
else
SUB_SetFade(gib, gib.giblifetime, 2);
-};
+}
void onslaught_updatelinks()
{
dprint("--- game over ---\n");
else
dprint("--- done updating links ---\n");
-};
+}
float onslaught_controlpoint_can_be_linked(entity cp, float t)
{
else if (overtime_msg_time)
overtime_msg_time = 0;
}
-};
+}
void onslaught_generator_ring_spawn(vector org)
{
modeleffect_spawn("models/onslaught/shockwavetransring.md3", 0, 0, org, '0 0 0', '0 0 0', '0 0 0', 0, -16, 0.1, 1.25, 0.25);
-};
+}
void onslaught_generator_ray_think()
{
self.scale += 0.2;
self.count +=1;
-};
+}
void onslaught_generator_ray_spawn(vector org)
{
e.scale = random() * 5 + 8;
e.think = onslaught_generator_ray_think;
e.nextthink = time + 0.05;
-};
+}
void onslaught_generator_shockwave_spawn(vector org)
{
shockwave_spawn("models/onslaught/shockwave.md3", org, -64, 0.75, 0.5);
-};
+}
void onslaught_generator_damage_think()
{
}
else
pointparticles(particleeffectnum("torch_small"), self.origin + randompos('-60 -60 -20', '60 60 60'), '0 0 0', 1);
-};
+}
void onslaught_generator_damage_spawn(entity gd_owner)
{
setorigin(e, gd_owner.origin);
e.think = onslaught_generator_damage_think;
e.nextthink = time+1;
-};
+}
void onslaught_generator_deaththink()
{
self.nextthink = time + 0.05;
self.count = self.count - 1;
-};
+}
void onslaught_generator_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
if(random() < damage/200+0.2)
if(random() < 0.5)
ons_throwgib(hitloc + '0 0 20', randomvec()*360, "models/onslaught/gen_gib1.md3", 5, FALSE);
-};
+}
// update links after a delay
void onslaught_generator_delayed()
// now begin normal thinking
self.think = onslaught_generator_think;
self.nextthink = time;
-};
+}
string onslaught_generator_waypointsprite_for_team(entity e, float t)
{
onslaught_updatelinks();
self.reset = onslaught_generator_reset;
-};
+}
.float waslinked;
.float cp_bob_spd;
remove(self);
}
-};
+}
void onslaught_controlpoint_icon_think()
{
else if (random() > 0.5)
sound(self, CH_PAIN, "onslaught/ons_spark2.wav", VOL_BASE, ATTN_NORM);
}
-};
+}
void onslaught_controlpoint_icon_buildthink()
{
if(random() < 0.9 - self.health / self.max_health)
pointparticles(particleeffectnum("rage"), self.origin + 10 * randomvec(), '0 0 -1', 1);
-};
+}
self.colormap = e.colormap;
WaypointSprite_UpdateBuildFinished(self.sprite, time + (e.max_health - e.health) / (e.count / sys_frametime));
onslaught_updatelinks();
-};
+}
void onslaught_controlpoint_reset()
{
onslaught_updatelinks();
self.reset = onslaught_controlpoint_reset;
-};
+}
float onslaught_link_send(entity to, float sendflags)
{
objerror("target and target2 must be set\n");
InitializeEntity(self, onslaught_link_delayed, INITPRIO_FINDTARGET);
Net_LinkEntity(self, FALSE, 0, onslaught_link_send);
-};
+}
{
v = v - 360 * floor(v / 360);
return v;
-};
+}
/*
==============================================================================
self.solid = SOLID_TRIGGER;
self.touch = t_movetarget;
setsize (self, '-8 -8 -8', '8 8 8');
-};
+}
/*QUAKED path_corner (0.5 0.3 0) (-8 -8 -8) (8 8 8)
Monsters will continue walking towards the next target corner.
void() path_corner =
{
movetarget_f ();
-};
+}
/*
=============
self.th_stand ();
return;
}
-};
+}
void() monster_wanderpaththink =
{
}
setorigin(self, v1 + self.owner.origin);
self.owner.ideal_yaw = vectoyaw(self.origin - self.owner.origin);
-};
+}
void() monster_wanderpathtouch =
{
sound (other, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);// play chainsaw drag sound
*/
monster_wanderpaththink();
-};
+}
void() monster_spawnwanderpath =
{
newmis.nextthink = time + random() * 10 + 1;
newmis.owner = self;
self.goalentity = self.movetarget = newmis;
-};
+}
void() monster_checkbossflag =
{
}
#endif
//#NO AUTOCVARS END
-};
+}
//============================================================================
if (r < 2000) // increased from 1000 for DP
return RANGE_MID;
return RANGE_FAR;
-};
+}
/*
=============
if (trace_fraction == 1)
return TRUE;
return FALSE;
-};
+}
/*
dot = normalize (targ.origin - self.origin) * v_forward;
return (dot > 0.3);
-};
+}
// returns 0 if not infront, or the dotproduct if infront
float(vector dir, entity targ) infront2 =
{
if (dot >= 0.3) return dot; // infront
return 0;
-};
+}
//============================================================================
current_yaw = anglemod (current_yaw + move);
self.angles_y = current_yaw;
-};
+}
*/
self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin);
self.nextthink = time + 0.1;
SUB_AttackFinished (1); // wait a while before first attack
-};
+}
.void() th_sightsound;
if (self.th_sightsound)
self.th_sightsound();
-};
+}
void() FoundTarget =
{
SightSound ();
HuntTarget ();
-};
+}
/*
//float checkplayertime;
}
while(check != lastcheckplayer && c < 100);
return world;
-};
+}
*/
/*
FoundTarget ();
return TRUE;
-};
+}
//=============================================================================
void(float dist) ai_forward =
{
walkmove (self.angles_y, dist);
-};
+}
void(float dist) ai_back =
{
walkmove ( (self.angles_y+180), dist);
-};
+}
void(float a) monster_setalpha;
if (self.health < 1)
return;
ai_back (dist);
-};
+}
/*
=============
if (self.health < 1)
return;
walkmove (self.ideal_yaw, dist);
-};
+}
/*
=============
movetogoal (dist);
monster_setalpha(0);
-};
+}
/*
// change angle slightly
monster_setalpha(0);
-};
+}
/*
=============
ChangeYaw ();
monster_setalpha(0);
-};
+}
//=============================================================================
dir_z = 0;
self.ideal_yaw = vectoyaw(dir);
-};
+}
/*
============
if (delta > 45 && delta < 315)
return FALSE;
return TRUE;
-};
+}
//=============================================================================
// head straight in
movetogoal (dist); // done in C code...
-};
+}
}
return FALSE;
-};
+}
/*
{
self.ideal_yaw = vectoyaw(self.enemy.origin - self.origin);
ChangeYaw ();
-};
+}
/*
=============
return;
ai_face ();
movetogoal (d); // done in C code...
-};
+}
void() ai_charge_side =
{
heading = vectoyaw(dtemp - self.origin);
walkmove(heading, 20);
-};
+}
/*
traceline(self.origin, self.enemy.origin, FALSE, self);
Damage (self.enemy, self, self, ldmg, self.projectiledeathtype, trace_endpos, '0 0 0'); // TODO add force to monster melee attacks?
-};
+}
void() ai_melee_side =
ldmg = ldmg + DMG_KNIGHT_MELEE_RANDOM3 * random();
traceline(self.origin, self.enemy.origin, FALSE, self);
Damage (self.enemy, self, self, ldmg, self.projectiledeathtype, trace_endpos, '0 0 0');
-};
+}
// self.nextthink = time + nexttime;
// self.think = nextthink
// <code>
-// };
+// }
.float ismonster;
self.enemy = activator;
self.nextthink = time + 0.1;
self.think = FoundTarget;
-};
+}
void() monster_appearsetup =
{
//self.movetype = MOVETYPE_NONE;
self.nextthink = -1;
self.model = "";
-};
+}
/*
================
}
}
self.alpha = SKILL4_MINALPHA + (1 - SKILL4_MINALPHA) * bound(0, a, 1);
-};
+}
/*
================
activator = self.enemy;
SUB_UseTargets ();
-};
+}
void() monsterinwall =
e.think = SUB_Null;
e.nextthink = -1;
e.scale = 16;
-};
+}
//============================================================================
force_retouch = 2; // mainly to detect teleports
monster_appearsetup();
-};
+}
void() walkmonster_start =
self.ismonster = TRUE;
monster_setalpha (0);
-};
+}
force_retouch = 2; // mainly to detect teleports
monster_appearsetup();
-};
+}
void() flymonster_start =
{
self.ismonster = TRUE;
monster_setalpha (0);
-};
+}
void() swimmonster_start_go =
force_retouch = 2; // mainly to detect teleports
monster_appearsetup();
-};
+}
void() swimmonster_start =
{
self.ismonster = TRUE;
monster_setalpha(0);
-};
+}
void(vector org, float bodydamage, float armordamage, vector force, float damgtype) genericbleedfunc =
{
e.cnt = teamcolor;
e.team = e.cnt + 1;
nb_teams += 1;
-};
+}
void nb_spawnteams (void)
{
.float rendermode;
.vector rendercolor;
-void spawnfunc_weapon_crossbow() {};
-void spawnfunc_weapon_handgrenade() {};
-void spawnfunc_ammo_crossbow() {};
-void spawnfunc_ammo_9mmclip() {};
-void spawnfunc_ammo_gaussclip() {};
-void spawnfunc_weapon_rpg() {};
-void spawnfunc_weapon_357() {};
-void ammo_ARgrenades() {};
-void spawnfunc_item_battery() {};
-void spawnfunc_ammo_rpgclip() {};
-void weapon_9mmAR() {};
-void spawnfunc_weapon_tripmine() {};
-void spawnfunc_weapon_snark() {};
-void spawnfunc_ammo_buckshot() {};
-void ammo_9mmAR() {};
-void spawnfunc_ammo_357() {};
-void spawnfunc_weapon_gauss() {};
-void spawnfunc_weapon_hornetgun() {};
-//void spawnfunc_weapon_shotgun() {};
-void spawnfunc_item_healthkit() {};
-void spawnfunc_item_longjump() {};
-void spawnfunc_item_antidote() {};
-void spawnfunc_func_recharge() {};
-void spawnfunc_info_node() {};
-void spawnfunc_env_sound() {};
-void spawnfunc_light_spot() {};
-void spawnfunc_func_healthcharger() {};
+void spawnfunc_weapon_crossbow() {}
+void spawnfunc_weapon_handgrenade() {}
+void spawnfunc_ammo_crossbow() {}
+void spawnfunc_ammo_9mmclip() {}
+void spawnfunc_ammo_gaussclip() {}
+void spawnfunc_weapon_rpg() {}
+void spawnfunc_weapon_357() {}
+void ammo_ARgrenades() {}
+void spawnfunc_item_battery() {}
+void spawnfunc_ammo_rpgclip() {}
+void weapon_9mmAR() {}
+void spawnfunc_weapon_tripmine() {}
+void spawnfunc_weapon_snark() {}
+void spawnfunc_ammo_buckshot() {}
+void ammo_9mmAR() {}
+void spawnfunc_ammo_357() {}
+void spawnfunc_weapon_gauss() {}
+void spawnfunc_weapon_hornetgun() {}
+//void spawnfunc_weapon_shotgun() {}
+void spawnfunc_item_healthkit() {}
+void spawnfunc_item_longjump() {}
+void spawnfunc_item_antidote() {}
+void spawnfunc_func_recharge() {}
+void spawnfunc_info_node() {}
+void spawnfunc_env_sound() {}
+void spawnfunc_light_spot() {}
+void spawnfunc_func_healthcharger() {}
void func_ladder_touch()
other.ladder_time = time + 0.1;
other.ladder_entity = self;
-};
+}
void spawnfunc_func_ladder()
{
EXACTTRIGGER_INIT;
self.touch = func_ladder_touch;
-};
+}
void spawnfunc_func_water()
{
EXACTTRIGGER_INIT;
self.touch = func_ladder_touch;
-};
+}
// pickup evaluation functions
// these functions decide how desirable an item is to the bots
-float generic_pickupevalfunc(entity player, entity item) {return item.bot_pickupbasevalue;};
+float generic_pickupevalfunc(entity player, entity item) {return item.bot_pickupbasevalue;}
float weapon_pickupevalfunc(entity player, entity item)
{
}
return item.bot_pickupbasevalue * c;
-};
+}
float commodity_pickupevalfunc(entity player, entity item)
{
c = c + max(0, 1 - player.health / item.max_health);
return item.bot_pickupbasevalue * c;
-};
+}
.float is_item;
self.think = SUB_Remove;
self.nextthink = time;
}
-};
+}
.vector dest;
void trigger_push_findtarget()
waypoint_spawnforteleporter(self, trace_endpos, vlen(trace_endpos - org) / vlen(e.velocity));
remove(e);
}
-};
+}
/*
* ENTITY PARAMETERS:
// this must be called to spawn the teleport waypoints for bots
InitializeEntity(self, trigger_push_findtarget, INITPRIO_FINDTARGET);
-};
+}
-void spawnfunc_target_push() {};
-void spawnfunc_info_notnull() {};
-void spawnfunc_target_position() {};
+void spawnfunc_target_push() {}
+void spawnfunc_info_notnull() {}
+void spawnfunc_target_position() {}
}
setsize (trigger, tmin, tmax);
-};
+}
void plat_hit_top()
{
self.state = 1;
self.think = plat_go_down;
self.nextthink = self.ltime + 3;
-};
+}
void plat_hit_bottom()
{
sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTN_NORM);
self.state = 2;
-};
+}
void plat_go_down()
{
sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_NORM);
self.state = 3;
SUB_CalcMove (self.pos2, self.speed, plat_hit_bottom);
-};
+}
void plat_go_up()
{
sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_NORM);
self.state = 4;
SUB_CalcMove (self.pos1, self.speed, plat_hit_top);
-};
+}
void plat_center_touch()
{
plat_go_up ();
else if (self.state == 1)
self.nextthink = self.ltime + 1; // delay going down
-};
+}
void plat_outside_touch()
{
self = self.enemy;
if (self.state == 1)
plat_go_down ();
-};
+}
void plat_trigger_use()
{
if (self.think)
return; // already activated
plat_go_down();
-};
+}
void plat_crush()
// plat state already had changed
// this isn't a bug per se!
}
-};
+}
void plat_use()
{
if (self.state != 4)
objerror ("plat_use: not in up state");
plat_go_down();
-};
+}
.string sound1, sound2;
}
}
-void spawnfunc_path_corner() { };
+void spawnfunc_path_corner() { }
void spawnfunc_func_plat()
{
if (!self.t_length)
self.reset = plat_reset;
plat_reset();
-};
+}
void() train_next;
SUB_UseTargets();
self = oldself;
self.enemy = world;
-};
+}
void train_next()
{
if(self.noise != "")
sound(self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTN_IDLE);
-};
+}
void func_train_find()
{
setorigin(self, targ.origin - self.mins);
self.nextthink = self.ltime + 1;
self.think = train_next;
-};
+}
/*QUAKED spawnfunc_func_train (0 .5 .8) ?
Ridable platform, targets spawnfunc_path_corner path to follow.
self.dmgtime2 = time;
// TODO make a reset function for this one
-};
+}
void func_rotating_setactive(float astate)
{
self.think = SUB_Null;
// TODO make a reset function for this one
-};
+}
.float height;
void func_bobbing_controller_think()
if(self.owner.classname == "func_bobbing") // don't brake stuff if the func_bobbing was killtarget'ed
// * 10 so it will arrive in 0.1 sec
self.owner.velocity = (v - self.owner.origin) * 10;
-};
+}
/*QUAKED spawnfunc_func_bobbing (0 .5 .8) ? X_AXIS Y_AXIS
Brush model that moves back and forth on one axis (default Z).
self.effects |= EF_LOWPRECISION;
// TODO make a reset function for this one
-};
+}
.float freq;
void func_pendulum_controller_think()
// * 10 so it will arrive in 0.1 sec
self.owner.avelocity_z = (remainder(v - self.owner.angles_z, 360)) * 10;
}
-};
+}
void spawnfunc_func_pendulum()
{
//self.effects |= EF_LOWPRECISION;
// TODO make a reset function for this one
-};
+}
// button and multiple button
activator = self.enemy;
SUB_UseTargets();
self.frame = 1; // use alternate textures
-};
+}
void button_done()
{
self.state = STATE_BOTTOM;
-};
+}
void button_return()
{
self.frame = 0; // use normal textures
if (self.health)
self.takedamage = DAMAGE_YES; // can be shot again
-};
+}
void button_blocked()
{
// do nothing, just don't come all the way back out
-};
+}
void button_fire()
self.state = STATE_UP;
SUB_CalcMove (self.pos2, self.speed, button_wait);
-};
+}
void button_reset()
{
self.enemy = activator;
button_fire ();
-};
+}
void button_touch()
{
if (other.owner)
self.enemy = other.owner;
button_fire ();
-};
+}
void button_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
self.enemy = damage_attacker;
button_fire ();
}
-};
+}
/*QUAKED spawnfunc_func_button (0 .5 .8) ?
self.flags |= FL_NOTARGET;
button_reset();
-};
+}
float DOOR_START_OPEN = 1;
door_go_down ();
}
*/
-};
+}
void door_hit_top()
self.think = door_rotating_go_down;
}
self.nextthink = self.ltime + self.wait;
-};
+}
void door_hit_bottom()
{
if (self.noise1 != "")
sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTN_NORM);
self.state = STATE_BOTTOM;
-};
+}
void door_go_down()
{
self.state = STATE_DOWN;
SUB_CalcMove (self.pos1, self.speed, door_hit_bottom);
-};
+}
void door_go_up()
{
self.message = "";
SUB_UseTargets();
self.message = oldmessage;
-};
+}
/*
self = self.enemy;
} while ( (self != starte) && (self != world) );
self = oself;
-};
+}
void door_use()
door_fire ();
self = oself;
}
-};
+}
void door_trigger_touch()
self = self.owner;
door_use ();
-};
+}
void door_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
door_use ();
self = oself;
}
-};
+}
/*
centerprint (other, self.owner.message);
play2(other, "misc/talk.wav");
}
-};
+}
void door_generic_plat_blocked()
door_rotating_go_down ();
}
*/
-};
+}
void door_rotating_hit_top()
return; // don't come down automatically
self.think = door_rotating_go_down;
self.nextthink = self.ltime + self.wait;
-};
+}
void door_rotating_hit_bottom()
{
self.lip = 0;
}
self.state = STATE_BOTTOM;
-};
+}
void door_rotating_go_down()
{
self.state = STATE_DOWN;
SUB_CalcAngleMove (self.pos1, self.speed, door_rotating_hit_bottom);
-};
+}
void door_rotating_go_up()
{
self.message = "";
SUB_UseTargets();
self.message = oldmessage;
-};
+}
t2 = fmaxs;
setsize (trigger, t1 - '60 60 8', t2 + '60 60 8');
return (trigger);
-};
+}
float EntitiesTouching(entity e1, entity e2)
if (e1.absmax_z < e2.absmin_z)
return FALSE;
return TRUE;
-};
+}
/*
}
} while (1 );
-};
+}
/*QUAKED spawnfunc_func_door (0 .5 .8) ? START_OPEN x DOOR_DONT_LINK x x TOGGLE
InitializeEntity(self, LinkDoors, INITPRIO_LINKDOORS);
self.reset = door_reset;
-};
+}
/*QUAKED spawnfunc_func_door_rotating (0 .5 .8) ? START_OPEN BIDIR DOOR_DONT_LINK BIDIR_IN_DOWN x TOGGLE X_AXIS Y_AXIS
if two doors touch, they are assumed to be connected and operate as a unit.
InitializeEntity(self, LinkDoors, INITPRIO_LINKDOORS);
self.reset = door_rotating_reset;
-};
+}
/*
=============================================================================
SUB_CalcMove(self.dest1, self.speed, fd_secret_move1);
if (self.noise2 != "")
sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
-};
+}
// Wait after first movement...
void fd_secret_move1()
self.think = fd_secret_move2;
if (self.noise3 != "")
sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTN_NORM);
-};
+}
// Start moving sideways w/sound...
void fd_secret_move2()
if (self.noise2 != "")
sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
SUB_CalcMove(self.dest2, self.speed, fd_secret_move3);
-};
+}
// Wait here until time to go back...
void fd_secret_move3()
self.nextthink = self.ltime + self.wait;
self.think = fd_secret_move4;
}
-};
+}
// Move backward...
void fd_secret_move4()
if (self.noise2 != "")
sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
SUB_CalcMove(self.dest1, self.speed, fd_secret_move5);
-};
+}
// Wait 1 second...
void fd_secret_move5()
self.think = fd_secret_move6;
if (self.noise3 != "")
sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTN_NORM);
-};
+}
void fd_secret_move6()
{
if (self.noise2 != "")
sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
SUB_CalcMove(self.oldorigin, self.speed, fd_secret_done);
-};
+}
void fd_secret_done()
{
}
if (self.noise3 != "")
sound(self, CH_TRIGGER_SINGLE, self.noise3, VOL_BASE, ATTN_NORM);
-};
+}
void secret_blocked()
{
return;
self.attack_finished_single = time + 0.5;
//T_Damage (other, self, self, self.dmg, self.dmg, self.deathtype, DT_IMPACT, (self.absmin + self.absmax) * 0.5, '0 0 0', Obituary_Generic);
-};
+}
/*
==============
centerprint (other, self.message);
play2(other, "misc/talk.wav");
}
-};
+}
void secret_reset()
{
self.reset = secret_reset;
secret_reset();
-};
+}
/*QUAKED spawnfunc_func_fourier (0 .5 .8) ?
Brush model that moves in a pattern of added up sine waves, can be used e.g. for circular motions.
if(self.owner.classname == "func_fourier") // don't brake stuff if the func_fourier was killtarget'ed
// * 10 so it will arrive in 0.1 sec
self.owner.velocity = (v - self.owner.origin) * 10;
-};
+}
void spawnfunc_func_fourier()
{
self.effects |= EF_LOWPRECISION;
// TODO make a reset function for this one
-};
+}
// reusing some fields havocbots declared
.entity wp00, wp01, wp02, wp03;
if(self.gametype)
{
string gametypename;
- // static char *gametypeNames[] = {"ffa", "tournament", "single", "team", "ctf", "oneflag", "obelisk", "harvester", "teamtournament"};
+ // static char *gametypeNames[] = {"ffa", "tournament", "single", "team", "ctf", "oneflag", "obelisk", "harvester", "teamtournament"}
gametypename = "ffa";
if(teamplay)
gametypename = "team";
self.swamp_interval = 1;
if(self.swamp_slowdown <= 0)
self.swamp_slowdown = 0.5;
-};
+}
void spawnfunc_trigger_relay_if()
{
self.use = trigger_relay_if_use;
-};
+}
e.netname = teamname;
e.cnt = teamcolor;
e.team = e.cnt + 1;
-};
+}
// spawn some default teams if the map is not set up for tdm
void tdm_spawnteams()
tdm_spawnteam("Yellow", COLOR_TEAM3-1);
if(numteams >= 4)
tdm_spawnteam("Pink", COLOR_TEAM4-1);
-};
+}
void tdm_delayedinit()
{
// if no teams are found, spawn defaults
if (find(world, classname, "tdm_team") == world)
tdm_spawnteams();
-};
+}
void tdm_init()
{
InitializeEntity(world, tdm_delayedinit, INITPRIO_GAMETYPE);
-};
+}
W_Reload(min(autocvar_g_balance_crylink_primary_ammo, autocvar_g_balance_crylink_secondary_ammo), autocvar_g_balance_crylink_reload_ammo, autocvar_g_balance_crylink_reload_time, "weapons/reload.wav");
}
return TRUE;
-};
+}
#endif
#ifdef CSQC
float w_crylink(float req)
W_Reload(min(autocvar_g_balance_electro_primary_ammo, autocvar_g_balance_electro_secondary_ammo), autocvar_g_balance_electro_reload_ammo, autocvar_g_balance_electro_reload_time, "weapons/reload.wav");
}
return TRUE;
-};
+}
#endif
#ifdef CSQC
float w_electro(float req)
W_Reload(min(autocvar_g_balance_fireball_primary_ammo, autocvar_g_balance_fireball_secondary_ammo), autocvar_g_balance_fireball_reload_ammo, autocvar_g_balance_fireball_reload_time, "weapons/reload.wav");
}
return TRUE;
-};
+}
#endif
#ifdef CSQC
float w_fireball(float req)
W_Reload(min(autocvar_g_balance_grenadelauncher_primary_ammo, autocvar_g_balance_grenadelauncher_secondary_ammo), autocvar_g_balance_grenadelauncher_reload_ammo, autocvar_g_balance_grenadelauncher_reload_time, "weapons/reload.wav");
}
return TRUE;
-};
+}
#endif
#ifdef CSQC
float w_glauncher(float req)
W_Reload(min(autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_secondary_ammo), autocvar_g_balance_hagar_reload_ammo, autocvar_g_balance_hagar_reload_time, "weapons/reload.wav");
}
return TRUE;
-};
+}
#endif
#ifdef CSQC
float w_hagar(float req)
{
weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hlac_primary_animtime, w_ready);
}
-};
+}
void spawnfunc_weapon_hlac (void)
{
W_Reload(min(autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_secondary_ammo), autocvar_g_balance_hlac_reload_ammo, autocvar_g_balance_hlac_reload_time, "weapons/reload.wav");
}
return TRUE;
-};
+}
#endif
#ifdef CSQC
float w_hlac(float req)
self.hook_refire = time;
}
return TRUE;
-};
+}
#endif
#ifdef CSQC
float w_hook(float req)
W_Reload(0, autocvar_g_balance_laser_reload_ammo, autocvar_g_balance_laser_reload_time, "weapons/reload.wav");
}
return TRUE;
-};
+}
#endif
#ifdef CSQC
float w_laser(float req)
W_Reload(autocvar_g_balance_minelayer_ammo, autocvar_g_balance_minelayer_reload_ammo, autocvar_g_balance_minelayer_reload_time, "weapons/reload.wav");
}
return TRUE;
-};
+}
#endif
#ifdef CSQC
float w_minelayer(float req)
W_Reload(used_ammo, autocvar_g_balance_minstanex_reload_ammo, autocvar_g_balance_minstanex_reload_time, "weapons/reload.wav");
}
return TRUE;
-};
+}
#endif
#ifdef CSQC
float w_minstanex(float req)
}
return TRUE;
-};
+}
#endif
#ifdef CSQC
float w_nex(float req)
self.porto_current = world;
}
return TRUE;
-};
+}
#endif
#ifdef CSQC
float w_porto(float req)
W_Reload(min(autocvar_g_balance_rifle_primary_ammo, autocvar_g_balance_rifle_secondary_ammo), autocvar_g_balance_rifle_reload_ammo, autocvar_g_balance_rifle_reload_time, "weapons/reload.wav");
}
return TRUE;
-};
+}
#endif
#ifdef CSQC
float w_rifle(float req)
W_Reload(autocvar_g_balance_rocketlauncher_ammo, autocvar_g_balance_rocketlauncher_reload_ammo, autocvar_g_balance_rocketlauncher_reload_time, "weapons/reload.wav");
}
return TRUE;
-};
+}
#endif
#ifdef CSQC
float w_rlauncher(float req)
W_Reload(min(autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_tag_ammo), autocvar_g_balance_seeker_reload_ammo, autocvar_g_balance_seeker_reload_time, "weapons/reload.wav");
}
return TRUE;
-};
+}
#endif
#ifdef CSQC
float w_seeker(float req)
W_Reload(autocvar_g_balance_shotgun_primary_ammo, autocvar_g_balance_shotgun_reload_ammo, autocvar_g_balance_shotgun_reload_time, "weapons/reload.wav");
}
return TRUE;
-};
+}
#endif
#ifdef CSQC
.float prevric;
else if (req == WR_CHECKAMMO2)
return TRUE; // TODO use fuel?
return TRUE;
-};
+}
#endif
#ifdef CSQC
float w_tuba(float req)
W_Reload(min(max(autocvar_g_balance_uzi_sustained_ammo, autocvar_g_balance_uzi_first_ammo), autocvar_g_balance_uzi_burst_ammo), autocvar_g_balance_uzi_reload_ammo, autocvar_g_balance_uzi_reload_time, "weapons/reload.wav");
}
return TRUE;
-};
+}
#endif
#ifdef CSQC
float w_uzi(float req)