set g_ctf_oneflag 1 "Allow oneflag CTF mode on maps that support it"
set g_ctf_oneflag_reverse 0 "apply reverse mode to oneflag CTF (take flag to enemy bases to cap), overrides g_ctf_reverse only in oneflag, g_ctf_reverse still affects oneflag"
set g_ctf_flag_return 1 "auto return the flag to base when touched by a teammate"
+set g_ctf_flag_return_carrying 0 "(manual return mode) auto return the flag to base if touched by a flag carrier"
set g_ctf_flag_return_carried_radius 100 "allow flags to be returned by carrier if base is within this radius"
set g_ctf_flag_return_time 15
set g_ctf_flag_return_dropped 100
--- /dev/null
+// bulldozer storage "level1" last updated 16-11-2015 03:11:33
+nextlevel = "level2"
+"k11" 1 "0 -1 0"
+"a20" 6 "0 0 0"
+"a19" 6 "0 0 0"
+"a18" 6 "0 0 0"
+"a17" 6 "0 0 0"
+"a15" 6 "0 0 0"
+"a14" 6 "0 0 0"
+"a13" 6 "0 0 0"
+"a12" 6 "0 0 0"
+"a11" 6 "0 0 0"
+"a10" 6 "0 0 0"
+"a9" 6 "0 0 0"
+"a8" 6 "0 0 0"
+"a7" 6 "0 0 0"
+"a6" 6 "0 0 0"
+"a5" 6 "0 0 0"
+"a4" 6 "0 0 0"
+"a3" 6 "0 0 0"
+"a2" 6 "0 0 0"
+"a1" 6 "0 0 0"
+"b1" 6 "0 0 0"
+"c1" 6 "0 0 0"
+"d1" 6 "0 0 0"
+"e1" 6 "0 0 0"
+"f1" 6 "0 0 0"
+"g1" 6 "0 0 0"
+"h1" 6 "0 0 0"
+"i1" 6 "0 0 0"
+"j1" 6 "0 0 0"
+"k1" 6 "0 0 0"
+"l1" 6 "0 0 0"
+"m1" 6 "0 0 0"
+"n1" 6 "0 0 0"
+"o1" 6 "0 0 0"
+"p1" 6 "0 0 0"
+"q1" 6 "0 0 0"
+"r1" 6 "0 0 0"
+"s1" 6 "0 0 0"
+"t1" 6 "0 0 0"
+"t2" 6 "0 0 0"
+"t3" 6 "0 0 0"
+"t4" 6 "0 0 0"
+"t5" 6 "0 0 0"
+"t6" 6 "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 -1 0"
+"b11" 4 "0 -1 0"
+"a15" 8 "0 -1 0"
+"a12" 4 "0 -1 0"
+"b12" 4 "0 -1 0"
+"c10" 8 "0 -1 0"
+"d12" 4 "0 -1 0"
+"d13" 4 "0 -1 0"
+"c13" 4 "0 -1 0"
+"b13" 4 "0 -1 0"
+"s16" 8 "0 -1 0"
+"a14" 4 "0 -1 0"
+"b14" 4 "0 -1 0"
+"c12" 8 "0 -1 0"
+"d14" 4 "0 -1 0"
+"e14" 4 "0 -1 0"
+"e15" 4 "0 -1 0"
+"d15" 4 "0 -1 0"
+"c15" 4 "0 -1 0"
+"b15" 4 "0 -1 0"
+"s10" 8 "0 -1 0"
+"a16" 4 "0 -1 0"
+"b16" 4 "0 -1 0"
+"c16" 8 "0 -1 0"
+"d16" 4 "0 -1 0"
+"e16" 4 "0 -1 0"
+"e17" 4 "0 -1 0"
+"d17" 4 "0 -1 0"
+"c17" 4 "0 -1 0"
+"b17" 4 "0 -1 0"
+"a17" 4 "0 -1 0"
+"a18" 4 "0 -1 0"
+"b18" 4 "0 -1 0"
+"c18" 4 "0 -1 0"
+"d18" 4 "0 -1 0"
+"e18" 4 "0 -1 0"
+"e19" 4 "0 -1 0"
+"d19" 4 "0 -1 0"
+"c19" 4 "0 -1 0"
+"b19" 4 "0 -1 0"
+"a19" 4 "0 -1 0"
+"a20" 4 "0 -1 0"
+"b20" 4 "0 -1 0"
+"c20" 4 "0 -1 0"
+"d20" 4 "0 -1 0"
+"e20" 4 "0 -1 0"
+"f11" 5 "0 -1 0"
+"c14" 8 "0 -1 0"
+"c8" 8 "0 -1 0"
+"f13" 5 "0 -1 0"
+"g15" 5 "0 -1 0"
+"g16" 5 "0 -1 0"
+"i16" 5 "0 -1 0"
+"j16" 5 "0 -1 0"
+"n15" 5 "0 -1 0"
+"n14" 5 "0 -1 0"
+"h7" 5 "0 -1 0"
--- /dev/null
+// bulldozer storage "level4" last updated 16-11-2015 04:16:07
+nextlevel = "level1"
+"e15" 3 "0 0 0"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"
+"t17" 4 "0 0 0"
+"s17" 4 "0 0 0"
+"b17" 4 "0 0 0"
+"a17" 4 "0 0 0"
+"a18" 4 "0 0 0"
+"b18" 4 "0 0 0"
+"s18" 4 "0 0 0"
+"t18" 4 "0 0 0"
+"t19" 4 "0 0 0"
+"s19" 4 "0 0 0"
+"r19" 4 "0 0 0"
+"q19" 4 "0 0 0"
+"p19" 4 "0 0 0"
+"o19" 4 "0 0 0"
+"n19" 4 "0 0 0"
+"m19" 4 "0 0 0"
+"l19" 4 "0 0 0"
+"k19" 4 "0 0 0"
+"j19" 4 "0 0 0"
+"i19" 4 "0 0 0"
+"h19" 4 "0 0 0"
+"g19" 4 "0 0 0"
+"f19" 4 "0 0 0"
+"e19" 4 "0 0 0"
+"d19" 4 "0 0 0"
+"c19" 4 "0 0 0"
+"b19" 4 "0 0 0"
+"a19" 4 "0 0 0"
+"a20" 4 "0 0 0"
+"b20" 4 "0 0 0"
+"c20" 4 "0 0 0"
+"d20" 4 "0 0 0"
+"e20" 4 "0 0 0"
+"f20" 4 "0 0 0"
+"g20" 4 "0 0 0"
+"h20" 4 "0 0 0"
+"i20" 4 "0 0 0"
+"j20" 4 "0 0 0"
+"k20" 4 "0 0 0"
+"l20" 4 "0 0 0"
+"m20" 4 "0 0 0"
+"n20" 4 "0 0 0"
+"o20" 4 "0 0 0"
+"p20" 4 "0 0 0"
+"q20" 4 "0 0 0"
+"r20" 4 "0 0 0"
+"s20" 4 "0 0 0"
+"t20" 4 "0 0 0"
return ret;
}
+entity announcer_countdown;
+
void Announcer_Countdown()
{
SELFPARAM();
{
Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_ROUNDSTOP);
remove(this);
+ announcer_countdown = NULL;
return;
}
if(roundstarttime >= starttime)
Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_BEGIN);
Local_Notification(MSG_MULTI, MULTI_COUNTDOWN_BEGIN);
remove(this);
+ announcer_countdown = NULL;
return;
}
else // countdown is still going
{
if(time < startTime)
{
- static entity announcer_countdown;
if (!announcer_countdown)
{
announcer_countdown = new(announcer_countdown);
// only if this failed, find it out on our own
entity e = spawn();
+ precache_model(autocvar__cl_playermodel);
_setmodel(e, autocvar__cl_playermodel); // this is harmless, see below
forceplayermodels_modelisgoodmodel = fexists(e.model);
forceplayermodels_model = e.model;
// CSQC_Ent_Update : Called every frame that the server has indicated an update to the SSQC / CSQC entity has occured.
// The only parameter reflects if the entity is "new" to the client, meaning it just came into the client's PVS.
-void CSQC_Ent_Update(float bIsNewEntity)
+void CSQC_Ent_Update(bool isnew)
{
SELFPARAM();
this.sourceLocLine = __LINE__;
}
#ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED
- if(this.enttype)
+ if (this.enttype)
{
- if(t != this.enttype || bIsNewEntity)
+ if (t != this.enttype || isnew)
{
LOG_INFOF("A CSQC entity changed its type! (edict: %d, server: %d, type: %d -> %d)\n", num_for_edict(this), this.entnum, this.enttype, t);
Ent_Remove();
clearentity(this);
- bIsNewEntity = 1;
+ isnew = true;
}
}
else
{
- if(!bIsNewEntity)
+ if (!isnew)
{
LOG_INFOF("A CSQC entity appeared out of nowhere! (edict: %d, server: %d, type: %d)\n", num_for_edict(this), this.entnum, t);
- bIsNewEntity = 1;
+ isnew = true;
}
}
#endif
this.enttype = t;
bool done = false;
FOREACH(LinkedEntities, it.m_id == t, LAMBDA(
- if (bIsNewEntity) this.classname = it.netname;
+ if (isnew) this.classname = it.netname;
if (autocvar_developer_csqcentities)
- LOG_INFOF("CSQC_Ent_Update(%d) with this=%i {.entnum=%d, .enttype=%d} t=%s (%d)\n", bIsNewEntity, this, this.entnum, this.enttype, it.netname, t);
- done = it.m_read(this, bIsNewEntity);
+ LOG_INFOF("CSQC_Ent_Update(%d) at %f with this=%i {.entnum=%d, .enttype=%d} t=%s (%d)\n", isnew, savetime, this, this.entnum, this.enttype, this.classname, t);
+ done = it.m_read(this, isnew);
break;
));
time = savetime;
if (!done)
{
- //error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), this.enttype));
- error(sprintf("Unknown entity type in CSQC_Ent_Update (enttype: %d, edict: %d, classname: %s)\n", this.enttype, num_for_edict(this), this.classname));
+ LOG_FATALF("CSQC_Ent_Update(%d) at %f with this=%i {.entnum=%d, .enttype=%d} t=%s (%d)\n", isnew, savetime, this, this.entnum, this.enttype, this.classname, t);
}
}
REGISTRY(GENERIC_COMMANDS, BITS(7))
#define GENERIC_COMMANDS_from(i) _GENERIC_COMMANDS_from(i, NULL)
REGISTER_REGISTRY(GENERIC_COMMANDS)
-REGISTRY_SORT(GENERIC_COMMANDS, 0)
+REGISTRY_SORT(GENERIC_COMMANDS)
#define GENERIC_COMMAND(id, description) \
CLASS(genericcommand_##id, Command) \
GameLogEcho(s);
}
-void ball_restart()
-{SELFPARAM();
- if(self.owner)
- DropBall(self, self.owner.origin, '0 0 0');
+void ball_restart(entity this)
+{
+ if(this.owner)
+ DropBall(this, this.owner.origin, '0 0 0');
ResetBall();
}
W_SetupProjVelocity_Basic(missile, autocvar_g_balance_nexball_secondary_speed, 0);
missile.angles = vectoangles(missile.velocity);
missile.touch = W_Nexball_Touch;
- missile.think = SUB_Remove;
+ missile.think = SUB_Remove_self;
missile.nextthink = time + autocvar_g_balance_nexball_secondary_lifetime; //FIXME: use a distance instead?
missile.effects = EF_BRIGHTFIELD | EF_LOWPRECISION;
}
}
-void ons_CaptureShield_Reset()
-{SELFPARAM();
- self.colormap = self.enemy.colormap;
- self.team = self.enemy.team;
+void ons_CaptureShield_Reset(entity this)
+{
+ this.colormap = this.enemy.colormap;
+ this.team = this.enemy.team;
}
void ons_CaptureShield_Spawn(entity generator, bool is_generator)
CSQCMODEL_AUTOUPDATE(self);
}
-void ons_ControlPoint_Reset()
-{SELFPARAM();
- if(self.goalentity)
- remove(self.goalentity);
-
- self.goalentity = world;
- self.team = 0;
- self.colormap = 1024;
- self.iscaptured = false;
- self.islinked = false;
- self.isshielded = true;
- self.think = ons_ControlPoint_Think;
- self.ons_toucher = world;
- self.nextthink = time + ONS_CP_THINKRATE;
- setmodel_fixsize(self, MDL_ONS_CP_PAD1);
-
- WaypointSprite_UpdateMaxHealth(self.sprite, 0);
- WaypointSprite_UpdateRule(self.sprite,self.team,SPRITERULE_TEAMPLAY);
+void ons_ControlPoint_Reset(entity this)
+{
+ if(this.goalentity)
+ remove(this.goalentity);
+
+ this.goalentity = world;
+ this.team = 0;
+ this.colormap = 1024;
+ this.iscaptured = false;
+ this.islinked = false;
+ this.isshielded = true;
+ this.think = ons_ControlPoint_Think;
+ this.ons_toucher = world;
+ this.nextthink = time + ONS_CP_THINKRATE;
+ setmodel_fixsize(this, MDL_ONS_CP_PAD1);
+
+ WaypointSprite_UpdateMaxHealth(this.sprite, 0);
+ WaypointSprite_UpdateRule(this.sprite,this.team,SPRITERULE_TEAMPLAY);
onslaught_updatelinks();
- activator = self;
+ activator = this;
SUB_UseTargets(); // to reset the structures, playerspawns etc.
- CSQCMODEL_AUTOUPDATE(self);
+ CSQCMODEL_AUTOUPDATE(this);
}
void ons_DelayedControlPoint_Setup()
}
}
-void ons_GeneratorReset()
-{SELFPARAM();
- self.team = self.team_saved;
- self.lasthealth = self.max_health = self.health = autocvar_g_onslaught_gen_health;
- self.takedamage = DAMAGE_AIM;
- self.bot_attack = true;
- self.iscaptured = true;
- self.islinked = true;
- self.isshielded = true;
- self.event_damage = ons_GeneratorDamage;
- self.think = ons_GeneratorThink;
- self.nextthink = time + GEN_THINKRATE;
-
- Net_LinkEntity(self, false, 0, generator_send);
-
- self.SendFlags = GSF_SETUP; // just incase
- self.SendFlags |= GSF_STATUS;
-
- WaypointSprite_UpdateMaxHealth(self.sprite, self.max_health);
- WaypointSprite_UpdateHealth(self.sprite, self.health);
- WaypointSprite_UpdateRule(self.sprite,self.team,SPRITERULE_TEAMPLAY);
+void ons_GeneratorReset(entity this)
+{
+ this.team = this.team_saved;
+ this.lasthealth = this.max_health = this.health = autocvar_g_onslaught_gen_health;
+ this.takedamage = DAMAGE_AIM;
+ this.bot_attack = true;
+ this.iscaptured = true;
+ this.islinked = true;
+ this.isshielded = true;
+ this.event_damage = ons_GeneratorDamage;
+ this.think = ons_GeneratorThink;
+ this.nextthink = time + GEN_THINKRATE;
+
+ Net_LinkEntity(this, false, 0, generator_send);
+
+ this.SendFlags = GSF_SETUP; // just incase
+ this.SendFlags |= GSF_STATUS;
+
+ WaypointSprite_UpdateMaxHealth(this.sprite, this.max_health);
+ WaypointSprite_UpdateHealth(this.sprite, this.health);
+ WaypointSprite_UpdateRule(this.sprite,this.team,SPRITERULE_TEAMPLAY);
onslaught_updatelinks();
}
/** If you register a new item, make sure to add it to all.inc */
#define REGISTER_ITEM(id, class) REGISTER(Items, ITEM, id, m_id, NEW(class))
-REGISTRY_SORT(Items, 0)
+REGISTRY_SORT(Items)
REGISTRY_CHECK(Items)
STATIC_INIT(Items) { FOREACH(Items, true, LAMBDA(it.m_id = i)); }
deactivate_minigame();
}
-vector ReadVector2D() { vector v; v_x = ReadCoord(); v_y = ReadCoord(); v_z = 0; return v; }
-vector ReadVector() { vector v; v_x = ReadCoord(); v_y = ReadCoord(); v_z = ReadCoord(); return v; }
string() ReadString_Raw = #366;
string ReadString_Zoned() { return strzone(ReadString_Raw()); }
#define ReadString ReadString_Zoned
while( (entityvar = findentity(entityvar,owner,active_minigame)) )
-REGISTRY(Minigames, BITS(3))
+REGISTRY(Minigames, BITS(4))
#define Minigames_from(i) _Minigames_from(i, NULL)
REGISTER_REGISTRY(Minigames)
REGISTRY_CHECK(Minigames)
#define REGISTER_MINIGAME(name,nicename) \
- REGISTER(Minigames, MINIGAME, name, m_id, new(minigame_descriptor)); \
+ REGISTER(Minigames, MINIGAME_##name, m_id, new(minigame_descriptor)); \
void name##_hud_board(vector, vector); \
void name##_hud_status(vector, vector); \
int name##_client_event(entity, string, ...); \
- REGISTER_INIT_POST(MINIGAME, name) { \
+ REGISTER_INIT_POST(MINIGAME_##name) { \
make_pure(this); \
this.netname = strzone(strtolower(#name)); \
this.message = nicename; \
this.minigame_hud_status = name##_hud_status; \
this.minigame_event = name##_client_event; \
} \
- REGISTER_INIT(MINIGAME, name)
+ REGISTER_INIT(MINIGAME_##name)
#endif
#include "ps.qc"
#include "pp.qc"
#include "snake.qc"
+#include "bd.qc"
/**
* Set up automatic entity read/write functionality
--- /dev/null
+REGISTER_MINIGAME(bd, "Bulldozer");
+
+const int BD_TURN_MOVE = 0x0100; // player must move the bulldozer
+const int BD_TURN_WIN = 0x0200; // victory
+const int BD_TURN_LOSS = 0x0400; // they did it?!
+const int BD_TURN_EDIT = 0x0800; // editing mode
+const int BD_TURN_TYPE = 0x0f00; // turn type mask
+
+const int BD_SF_PLAYERMOVES = MINIG_SF_CUSTOM;
+
+// 240 tiles...
+const int BD_LET_CNT = 20;
+const int BD_NUM_CNT = 20;
+
+const int BD_TILE_SIZE = 20;
+
+const int BD_TEAMS = 1;
+
+.vector bd_dir;
+
+.int bd_moves;
+
+.string bd_levelname;
+.string bd_nextlevel;
+
+#ifdef SVQC
+.bool bd_canedit;
+#endif
+
+.int bd_tiletype;
+const int BD_TILE_DOZER = 1;
+const int BD_TILE_TARGET = 2;
+const int BD_TILE_BOULDER = 3;
+const int BD_TILE_BRICK1 = 4;
+const int BD_TILE_BRICK2 = 5;
+const int BD_TILE_BRICK3 = 6;
+const int BD_TILE_BRICK4 = 7;
+const int BD_TILE_BRICK5 = 8;
+const int BD_TILE_BRICK6 = 9;
+const int BD_TILE_LAST = 9;
+
+string autocvar_sv_minigames_bulldozer_startlevel = "level1";
+
+// find same game piece given its tile name
+entity bd_find_piece(entity minig, string tile, bool check_target)
+{
+ entity e = world;
+ while ( ( e = findentity(e,owner,minig) ) )
+ if ( e.classname == "minigame_board_piece" && e.netname == tile && ((check_target) ? e.bd_tiletype == BD_TILE_TARGET : e.bd_tiletype != BD_TILE_TARGET) )
+ return e;
+ return world;
+}
+
+// check if the tile name is valid (15x15 grid)
+bool bd_valid_tile(string tile)
+{
+ if ( !tile )
+ return false;
+ int number = minigame_tile_number(tile);
+ int letter = minigame_tile_letter(tile);
+ return 0 <= number && number < BD_NUM_CNT && 0 <= letter && letter < BD_LET_CNT;
+}
+
+entity bd_find_dozer(entity minig)
+{
+ entity e = world;
+ while ( ( e = findentity(e,owner,minig) ) )
+ if ( e.classname == "minigame_board_piece" && e.bd_tiletype == BD_TILE_DOZER )
+ return e;
+ return world;
+}
+
+void bd_check_winner(entity minig)
+{
+ int total = 0, valid = 0;
+ entity e = world;
+ while ( ( e = findentity(e,owner,minig) ) )
+ if ( e.classname == "minigame_board_piece" && e.bd_tiletype == BD_TILE_TARGET )
+ {
+ ++total;
+ if(bd_find_piece(minig, e.netname, false).bd_tiletype == BD_TILE_BOULDER)
+ ++valid;
+ }
+
+ if(valid >= total)
+ {
+ minig.minigame_flags = BD_TURN_WIN;
+ minigame_server_sendflags(minig,MINIG_SF_UPDATE);
+ }
+}
+
+bool bd_canfill(int ttype)
+{
+ switch(ttype)
+ {
+ case BD_TILE_BRICK6:
+ case BD_TILE_BRICK5:
+ case BD_TILE_BRICK4:
+ case BD_TILE_BRICK3:
+ case BD_TILE_BRICK2:
+ case BD_TILE_BRICK1: return true;
+ }
+
+ return false;
+}
+
+bool bd_move_dozer(entity minigame, entity dozer)
+{
+ if(!dozer.bd_dir_x && !dozer.bd_dir_y)
+ return false; // nope!
+
+ int myx = minigame_tile_letter(dozer.netname);
+ int myy = minigame_tile_number(dozer.netname);
+
+ myx += dozer.bd_dir_x;
+ myy += dozer.bd_dir_y;
+
+ string newpos = minigame_tile_buildname(myx, myy);
+ entity hit = bd_find_piece(minigame, newpos, false);
+
+ if(!bd_valid_tile(newpos))
+ return false;
+
+ if(hit)
+ switch(hit.bd_tiletype)
+ {
+ case BD_TILE_DOZER: // wtf, but let's do this incase
+ case BD_TILE_BRICK6:
+ case BD_TILE_BRICK5:
+ case BD_TILE_BRICK4:
+ case BD_TILE_BRICK3:
+ case BD_TILE_BRICK2:
+ case BD_TILE_BRICK1: return false;
+ case BD_TILE_BOULDER:
+ {
+ string testpos;
+ int tx = minigame_tile_letter(hit.netname);
+ int ty = minigame_tile_number(hit.netname);
+
+ tx += dozer.bd_dir_x;
+ ty += dozer.bd_dir_y;
+
+ testpos = minigame_tile_buildname(tx, ty);
+ entity testhit = bd_find_piece(minigame, testpos, false);
+
+ if(!bd_valid_tile(testpos) || testhit)
+ return false;
+
+ if(hit.netname) { strunzone(hit.netname); }
+ hit.netname = strzone(testpos);
+ minigame_server_sendflags(hit,MINIG_SF_UPDATE);
+ break;
+ }
+ }
+
+ if(dozer.netname) { strunzone(dozer.netname); }
+ dozer.netname = strzone(newpos);
+
+ return true;
+}
+
+// make a move
+void bd_move(entity minigame, entity player, string dir)
+{
+ if ( minigame.minigame_flags & BD_TURN_MOVE )
+ if ( dir )
+ {
+ //if ( bd_valid_tile(pos) )
+ //if ( bd_find_piece(minigame, pos, false) )
+ {
+ entity dozer = bd_find_dozer(minigame);
+ if(!dozer)
+ {
+ LOG_INFO("Dozer wasn't found!\n");
+ return; // should not happen... TODO: end match?
+ }
+
+ int dxs = 0, dys = 0;
+ string thedir = strtolower(dir);
+ if(thedir == "up" || thedir == "u") { dxs = 0; dys = 1; }
+ if(thedir == "down" || thedir == "dn" || thedir == "d") { dxs = 0; dys = -1; }
+ if(thedir == "left" || thedir == "lt" || thedir == "l") { dxs = -1; dys = 0; }
+ if(thedir == "right" || thedir == "rt" || thedir == "r") { dxs = 1; dys = 0; }
+
+ int dx = bound(-1, dxs, 1);
+ int dy = bound(-1, dys, 1);
+
+ dozer.bd_dir_x = dx;
+ dozer.bd_dir_y = dy;
+ dozer.bd_dir_z = 0;
+
+ if(bd_move_dozer(minigame, dozer))
+ player.bd_moves++;
+
+ bd_check_winner(minigame);
+
+ minigame_server_sendflags(dozer,MINIG_SF_UPDATE); // update anyway
+ minigame_server_sendflags(player,BD_SF_PLAYERMOVES);
+ minigame_server_sendflags(minigame,MINIG_SF_UPDATE);
+ }
+ }
+}
+
+// editor
+void bd_editor_place(entity minigame, entity player, string pos, int thetile, string thedir)
+{
+ if ( minigame.minigame_flags & BD_TURN_EDIT )
+ if ( pos && thetile )
+ {
+ if ( bd_valid_tile(pos) )
+ {
+ entity found_piece = bd_find_piece(minigame, pos, false);
+ entity targ = bd_find_piece(minigame, pos, true);
+
+ if(found_piece.bd_tiletype == BD_TILE_DOZER && thedir != "")
+ {
+ int dxs = 0, dys = 0;
+ string newdir = strtolower(thedir);
+ if(newdir == "up" || newdir == "u") { dxs = 0; dys = 1; }
+ if(newdir == "down" || newdir == "dn" || newdir == "d") { dxs = 0; dys = -1; }
+ if(newdir == "left" || newdir == "lt" || newdir == "l") { dxs = -1; dys = 0; }
+ if(newdir == "right" || newdir == "rt" || newdir == "r") { dxs = 1; dys = 0; }
+
+ int dx = bound(-1, dxs, 1);
+ int dy = bound(-1, dys, 1);
+
+ found_piece.bd_dir_x = dx;
+ found_piece.bd_dir_y = dy;
+ found_piece.bd_dir_z = 0;
+ minigame_server_sendflags(found_piece,MINIG_SF_UPDATE); // update anyway
+ return;
+ }
+
+ entity dozer = bd_find_dozer(minigame);
+ if(dozer && thetile == BD_TILE_DOZER && pos != dozer.netname)
+ return; // nice try
+
+ if(found_piece || (targ && thetile != BD_TILE_BOULDER))
+ {
+ entity piece = bd_find_piece(minigame, pos, false);
+ if(!piece) piece = bd_find_piece(minigame, pos, true);
+ if(!piece)
+ return; // how?!
+
+ if(piece.netname) { strunzone(piece.netname); }
+ remove(piece);
+ minigame_server_sendflags(minigame,MINIG_SF_UPDATE);
+ return;
+ }
+
+ entity piece = msle_spawn(minigame,"minigame_board_piece");
+ piece.team = 1;
+ piece.netname = strzone(pos);
+ piece.bd_tiletype = thetile;
+ piece.bd_dir = '0 -1 0';
+ minigame_server_sendflags(piece,MINIG_SF_UPDATE);
+
+ minigame_server_sendflags(minigame,MINIG_SF_UPDATE);
+ }
+ }
+}
+
+void bd_do_move(entity minigame, entity player, string dir, string thetile, string thedir)
+{
+ if(minigame.minigame_flags & BD_TURN_MOVE)
+ bd_move(minigame, player, dir);
+
+ if(minigame.minigame_flags & BD_TURN_EDIT)
+ bd_editor_place(minigame, player, dir, stof(thetile), thedir);
+}
+
+void bd_fill_recurse(entity minigame, entity player, int thetype, int letter, int number)
+{
+ string pos = minigame_tile_buildname(letter,number);
+ if(!bd_valid_tile(pos))
+ return;
+ if(bd_find_piece(minigame, pos, false) || bd_find_piece(minigame, pos, true))
+ return;
+
+ bd_editor_place(minigame, player, pos, thetype, "");
+
+ bd_fill_recurse(minigame, player, thetype, letter - 1, number);
+ bd_fill_recurse(minigame, player, thetype, letter + 1, number);
+ bd_fill_recurse(minigame, player, thetype, letter, number - 1);
+ bd_fill_recurse(minigame, player, thetype, letter, number + 1);
+}
+
+void bd_unfill_recurse(entity minigame, entity player, int thetype, int letter, int number)
+{
+ string pos = minigame_tile_buildname(letter,number);
+ if(!bd_valid_tile(pos))
+ return;
+
+ entity targ = bd_find_piece(minigame, pos, true);
+ entity piece = bd_find_piece(minigame, pos, false);
+
+ if(targ && thetype == targ.bd_tiletype)
+ {
+ if(targ.netname) { strunzone(targ.netname); }
+ remove(targ);
+ }
+ else if(piece && thetype == piece.bd_tiletype)
+ {
+ if(piece.netname) { strunzone(piece.netname); }
+ remove(piece);
+ }
+ else return;
+
+ bd_unfill_recurse(minigame, player, thetype, letter - 1, number);
+ bd_unfill_recurse(minigame, player, thetype, letter + 1, number);
+ bd_unfill_recurse(minigame, player, thetype, letter, number - 1);
+ bd_unfill_recurse(minigame, player, thetype, letter, number + 1);
+}
+
+void bd_do_fill(entity minigame, entity player, string dir, string thetile)
+{
+ if(minigame.minigame_flags & BD_TURN_EDIT)
+ {
+ int thetype = stof(thetile);
+
+ entity targ = bd_find_piece(minigame, dir, true);
+ entity piece = bd_find_piece(minigame, dir, false);
+
+ if(!bd_canfill(thetype) || (piece || targ))
+ {
+ int killtype = 0;
+
+ if(targ) { killtype = targ.bd_tiletype; }
+ if(piece) { killtype = piece.bd_tiletype; }
+
+ if(killtype)
+ {
+ int letter = minigame_tile_letter(dir);
+ int number = minigame_tile_number(dir);
+ bd_unfill_recurse(minigame, player, killtype, letter, number);
+ }
+
+ return;
+ }
+
+ int letter = minigame_tile_letter(dir);
+ int number = minigame_tile_number(dir);
+
+ bd_fill_recurse(minigame, player, thetype, letter, number);
+ }
+}
+
+void bd_reset_moves(entity minigame)
+{
+ entity e;
+#ifdef SVQC
+ for(e = minigame.minigame_players; e; e = e.list_next)
+#elif defined(CSQC)
+ e = world;
+ while( (e = findentity(e,owner,minigame)) )
+ if ( e.classname == "minigame_player" )
+#endif
+ {
+ e.bd_moves = 0;
+ minigame_server_sendflags(e,BD_SF_PLAYERMOVES);
+ }
+}
+
+void bd_load_level(entity minigame);
+void bd_setup_pieces(entity minigame)
+{
+ entity e = world;
+ while( (e = findentity(e, owner, minigame)) )
+ if(e.classname == "minigame_board_piece")
+ {
+ if(e.netname) { strunzone(e.netname); }
+ remove(e);
+ }
+
+ bd_load_level(minigame);
+}
+
+void bd_do_next_match(entity minigame, entity player)
+{
+ minigame.minigame_flags = BD_TURN_MOVE;
+ minigame_server_sendflags(minigame,MINIG_SF_UPDATE);
+
+ if(minigame.bd_nextlevel && minigame.bd_nextlevel != "")
+ {
+ if(minigame.bd_levelname) { strunzone(minigame.bd_levelname); }
+ minigame.bd_levelname = strzone(minigame.bd_nextlevel);
+ }
+
+ bd_setup_pieces(minigame);
+
+ bd_reset_moves(minigame);
+}
+
+void bd_set_next_match(entity minigame, string next)
+{
+ if(minigame.bd_nextlevel) { strunzone(minigame.bd_nextlevel); }
+ minigame.bd_nextlevel = strzone(next);
+}
+
+void bd_next_match(entity minigame, entity player, string next)
+{
+ if(minigame.minigame_flags & BD_TURN_WIN)
+ bd_do_next_match(minigame, player);
+ if(minigame.minigame_flags & BD_TURN_EDIT)
+ bd_set_next_match(minigame, next);
+}
+
+// request a new match
+void bd_restart_match(entity minigame, entity player)
+{
+ minigame.minigame_flags = BD_TURN_MOVE;
+ minigame_server_sendflags(minigame,MINIG_SF_UPDATE);
+
+ bd_setup_pieces(minigame);
+
+ bd_reset_moves(minigame);
+}
+
+void bd_activate_editor(entity minigame, entity player)
+{
+#ifdef SVQC
+ if(!player.minigame_players.bd_canedit)
+ {
+ sprint(player.minigame_players, "You're not allowed to edit levels, sorry!\n");
+ return;
+ }
+#endif
+
+ minigame.minigame_flags = BD_TURN_EDIT;
+ minigame_server_sendflags(minigame,MINIG_SF_UPDATE);
+
+ bd_reset_moves(minigame);
+
+ bd_setup_pieces(minigame);
+}
+
+string bd_save_piece(entity minigame, entity e)
+{
+ string bd_string = "";
+
+ bd_string = strcat(bd_string, "\"", e.netname, "\" ");
+ bd_string = strcat(bd_string, ftos(e.bd_tiletype), " ");
+ bd_string = strcat(bd_string, sprintf("\"%.9v\"", e.bd_dir));
+
+ return bd_string;
+}
+
+void bd_set_nextlevel(entity minigame, string s)
+{
+ tokenize_console(s);
+
+ if(minigame.bd_nextlevel) { strunzone(minigame.bd_nextlevel); }
+ minigame.bd_nextlevel = strzone(argv(2));
+}
+
+entity bd_load_piece(entity minigame, string s)
+{
+ // separate pieces between the ; symbols
+ string bd_string = s;
+
+ tokenize_console(bd_string);
+
+ entity e = msle_spawn(minigame,"minigame_board_piece");
+ e.team = 1;
+ e.bd_dir = '0 -1 0';
+
+ int argv_num = 0;
+ e.netname = strzone(argv(argv_num)); ++argv_num;
+ e.bd_tiletype = stof(argv(argv_num)); ++argv_num;
+ e.bd_dir = stov(argv(argv_num)); ++argv_num;
+
+ minigame_server_sendflags(e,MINIG_SF_ALL);
+
+ return e;
+}
+
+bool bd_save_level(entity minigame)
+{
+ if(minigame.bd_levelname && minigame.bd_levelname != "")
+ {
+ int target_count = 0, boulder_count = 0;
+ entity piece = world;
+ while((piece = findentity(piece,owner,minigame)))
+ if(piece.classname == "minigame_board_piece")
+ if(piece.bd_tiletype == BD_TILE_BOULDER)
+ ++boulder_count;
+ else if(piece.bd_tiletype == BD_TILE_TARGET)
+ ++target_count;
+
+ if(boulder_count != target_count)
+ {
+ LOG_INFO("Not enough targets or boulders, fix your level!\n");
+ return false;
+ }
+
+ // saves all objects to the database file
+ string file_name;
+ float file_get;
+
+ file_name = strcat("minigames/bulldozer/storage_", minigame.bd_levelname, ".txt");
+ file_get = fopen(file_name, FILE_WRITE);
+ fputs(file_get, strcat("// bulldozer storage \"", minigame.bd_levelname, "\" last updated ", strftime(true, "%d-%m-%Y %H:%M:%S"), "\n"));
+
+ if(minigame.bd_nextlevel && minigame.bd_nextlevel != "" && fexists(strcat("minigames/bulldozer/storage_", minigame.bd_nextlevel, ".txt")))
+ fputs(file_get, strcat("nextlevel = \"", minigame.bd_nextlevel, "\"\n"));
+
+ entity e = world;
+ while ( ( e = findentity(e,owner,minigame) ) )
+ if ( e.classname == "minigame_board_piece" )
+ {
+ // use a line of text for each object, listing all properties
+ fputs(file_get, strcat(bd_save_piece(minigame, e), "\n"));
+ }
+ fclose(file_get);
+
+ return true;
+ }
+
+ return false;
+}
+
+void bd_load_level(entity minigame)
+{
+ // loads all items from the database file
+ string file_read, file_name;
+ float file_get;
+
+ file_name = strcat("minigames/bulldozer/storage_", minigame.bd_levelname, ".txt");
+ file_get = fopen(file_name, FILE_READ);
+ if(file_get < 0)
+ {
+ LOG_INFO("^3BULLDOZER: ^7could not find storage file ^3", file_name, "^7, no items were loaded\n");
+ }
+ else
+ {
+ for(;;)
+ {
+ file_read = fgets(file_get);
+ if(file_read == "")
+ break;
+ if(substring(file_read, 0, 2) == "//")
+ continue;
+ if(substring(file_read, 0, 1) == "#")
+ continue;
+ if(substring(file_read, 0, 9) == "nextlevel")
+ {
+ bd_set_nextlevel(minigame, file_read);
+ continue;
+ }
+
+ entity e;
+ e = bd_load_piece(minigame, file_read);
+ }
+ }
+ fclose(file_get);
+}
+
+void bd_close_editor(entity minigame)
+{
+ entity dozer = bd_find_dozer(minigame);
+ if(!dozer)
+ {
+ LOG_INFO("You need to place a bulldozer on the level to save it!\n");
+ return;
+ }
+
+ if(bd_save_level(minigame))
+ {
+ minigame.minigame_flags = BD_TURN_MOVE;
+ minigame_server_sendflags(minigame,MINIG_SF_UPDATE);
+ }
+ else
+ {
+ LOG_INFO("You need to set the level name!\n");
+ return;
+ }
+}
+
+#ifdef SVQC
+
+// required function, handle server side events
+int bd_server_event(entity minigame, string event, ...)
+{
+ switch(event)
+ {
+ case "start":
+ {
+ if(minigame.bd_levelname) { strunzone(minigame.bd_levelname); }
+ minigame.bd_levelname = strzone(autocvar_sv_minigames_bulldozer_startlevel);
+ bd_setup_pieces(minigame);
+ minigame.minigame_flags = BD_TURN_MOVE;
+
+ return true;
+ }
+ case "end":
+ {
+ entity e = world;
+ while( (e = findentity(e, owner, minigame)) )
+ if(e.classname == "minigame_board_piece")
+ {
+ if(e.netname) { strunzone(e.netname); }
+ remove(e);
+ }
+
+ if(minigame.bd_nextlevel) { strunzone(minigame.bd_nextlevel); }
+ if(minigame.bd_levelname) { strunzone(minigame.bd_levelname); }
+ return false;
+ }
+ case "join":
+ {
+ int pl_num = minigame_count_players(minigame);
+
+ if(pl_num >= BD_TEAMS) { return false; }
+
+ return 1;
+ }
+ case "cmd":
+ {
+ switch(argv(0))
+ {
+ case "move":
+ bd_do_move(minigame, ...(0,entity), ((...(1,int)) >= 2 ? argv(1) : string_null), ((...(1,int)) >= 3 ? argv(2) : string_null), ((...(1,int)) >= 4 ? argv(3) : string_null));
+ return true;
+ case "next":
+ bd_next_match(minigame,...(0,entity), ((...(1,int) >= 2 ? argv(1) : string_null)));
+ return true;
+ case "restart":
+ bd_restart_match(minigame,...(0,entity));
+ return true;
+ case "edit":
+ bd_activate_editor(minigame,...(0,entity));
+ return true;
+ case "save":
+ bd_close_editor(minigame);
+ return true;
+ case "fill":
+ bd_do_fill(minigame, ...(0,entity), ((...(1,int)) >= 2 ? argv(1) : string_null), ((...(1,int)) >= 3 ? argv(2) : string_null));
+ return true;
+ }
+
+ return false;
+ }
+ case "network_send":
+ {
+ entity sent = ...(0,entity);
+ int sf = ...(1,int);
+ if ( sent.classname == "minigame_board_piece" && (sf & MINIG_SF_UPDATE) )
+ {
+ int letter = minigame_tile_letter(sent.netname);
+ int number = minigame_tile_number(sent.netname);
+
+ WriteByte(MSG_ENTITY,letter);
+ WriteByte(MSG_ENTITY,number);
+
+ WriteByte(MSG_ENTITY,sent.bd_tiletype);
+
+ int dx = sent.bd_dir_x;
+ int dy = sent.bd_dir_y;
+ if(dx == -1) dx = 2;
+ if(dy == -1) dy = 2;
+ WriteByte(MSG_ENTITY,dx);
+ WriteByte(MSG_ENTITY,dy);
+ }
+ else if(sent.classname == "minigame_player" && (sf & BD_SF_PLAYERMOVES))
+ WriteShort(MSG_ENTITY,sent.bd_moves);
+ return false;
+ }
+ }
+
+ return false;
+}
+
+
+#elif defined(CSQC)
+
+int bd_curr_tile;
+string bd_curr_pos;
+
+vector bd_boardpos; // HUD board position
+vector bd_boardsize;// HUD board size
+
+string bd_get_tile_pic(int tileid)
+{
+ switch(tileid)
+ {
+ case BD_TILE_BOULDER: return "bd/boulder";
+ case BD_TILE_BRICK1: return "bd/brick1";
+ case BD_TILE_BRICK2: return "bd/brick2";
+ case BD_TILE_BRICK3: return "bd/brick3";
+ case BD_TILE_BRICK4: return "bd/brick4";
+ case BD_TILE_BRICK5: return "bd/brick5";
+ case BD_TILE_BRICK6: return "bd/brick6";
+ case BD_TILE_TARGET: return "bd/target";
+ case BD_TILE_DOZER: return "bd/dozer";
+ }
+
+ return string_null;
+}
+
+// Required function, draw the game board
+void bd_hud_board(vector pos, vector mySize)
+{
+ minigame_hud_fitsqare(pos, mySize);
+ bd_boardpos = pos;
+ bd_boardsize = mySize;
+
+ minigame_hud_simpleboard(pos,mySize,minigame_texture("bd/board"));
+
+ vector tile_size = minigame_hud_denormalize_size('1 1 0' / BD_TILE_SIZE,pos,mySize);
+ vector tile_pos;
+
+ entity e;
+ FOREACH_MINIGAME_ENTITY(e)
+ {
+ if ( e.classname == "minigame_board_piece" && e.bd_tiletype != BD_TILE_TARGET && e.bd_tiletype != BD_TILE_DOZER )
+ {
+ tile_pos = minigame_tile_pos(e.netname,BD_NUM_CNT,BD_LET_CNT);
+ tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
+
+ string thepiece = bd_get_tile_pic(e.bd_tiletype);
+
+ minigame_drawpic_centered( tile_pos,
+ minigame_texture(thepiece),
+ tile_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL );
+ }
+
+ if ( e.classname == "minigame_board_piece" && e.bd_tiletype == BD_TILE_TARGET && e.bd_tiletype != BD_TILE_DOZER )
+ {
+ tile_pos = minigame_tile_pos(e.netname,BD_NUM_CNT,BD_LET_CNT);
+ tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
+
+ minigame_drawpic_centered( tile_pos,
+ minigame_texture("bd/target"),
+ tile_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL );
+ }
+
+ if ( e.classname == "minigame_board_piece" && e.bd_tiletype != BD_TILE_TARGET && e.bd_tiletype == BD_TILE_DOZER )
+ {
+ tile_pos = minigame_tile_pos(e.netname,BD_NUM_CNT,BD_LET_CNT);
+ tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
+
+ vector thedir = e.bd_dir;
+ float theang = 0;
+
+ if(thedir_y == -1) { theang = M_PI; }
+ if(thedir_x == 1) { theang = M_PI/2; }
+ if(thedir_x == -1) { theang = M_PI*3/2; }
+
+ drawrotpic(tile_pos, theang, minigame_texture("bd/dozer"),
+ tile_size, tile_size/2, '1 1 1',
+ panel_fg_alpha, DRAWFLAG_NORMAL );
+ }
+ }
+
+ FOREACH_MINIGAME_ENTITY(e)
+ {
+ if ( e.classname == "minigame_board_piece" && e.bd_tiletype == BD_TILE_TARGET )
+ {
+ tile_pos = minigame_tile_pos(e.netname,BD_NUM_CNT,BD_LET_CNT);
+ tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
+
+ minigame_drawpic_centered( tile_pos,
+ minigame_texture("bd/target"),
+ tile_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL );
+ }
+ }
+
+ FOREACH_MINIGAME_ENTITY(e)
+ {
+ if ( e.classname == "minigame_board_piece" && e.bd_tiletype == BD_TILE_DOZER )
+ {
+ tile_pos = minigame_tile_pos(e.netname,BD_NUM_CNT,BD_LET_CNT);
+ tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
+
+ vector thedir = e.bd_dir;
+ float theang = 0;
+
+ if(thedir_y == -1) { theang = M_PI; }
+ if(thedir_x == 1) { theang = M_PI/2; }
+ if(thedir_x == -1) { theang = M_PI*3/2; }
+
+ drawrotpic(tile_pos, theang, minigame_texture("bd/dozer"),
+ tile_size, tile_size/2, '1 1 1',
+ panel_fg_alpha, DRAWFLAG_NORMAL );
+ }
+ }
+
+ if(active_minigame.minigame_flags & BD_TURN_EDIT)
+ if(bd_valid_tile(bd_curr_pos))
+ {
+ entity piece = bd_find_piece(active_minigame, bd_curr_pos, false);
+ entity targ = bd_find_piece(active_minigame, bd_curr_pos, true);
+ string thepiece = ((piece || (targ && bd_curr_tile != BD_TILE_BOULDER)) ? "bd/delete" : bd_get_tile_pic(bd_curr_tile));
+
+ tile_pos = minigame_tile_pos(bd_curr_pos,BD_LET_CNT,BD_NUM_CNT);
+ tile_pos = minigame_hud_denormalize(tile_pos,pos,mySize);
+ if(bd_curr_tile == BD_TILE_DOZER)
+ {
+ drawrotpic(tile_pos, M_PI, minigame_texture("bd/dozer"),
+ tile_size, tile_size/2, '1 1 1',
+ panel_fg_alpha/2, DRAWFLAG_NORMAL );
+ }
+ else
+ {
+ minigame_drawpic_centered( tile_pos,
+ minigame_texture(thepiece),
+ tile_size, '1 1 1', panel_fg_alpha/2, DRAWFLAG_NORMAL );
+ }
+ }
+
+ if ( (active_minigame.minigame_flags & BD_TURN_LOSS) || (active_minigame.minigame_flags & BD_TURN_WIN) )
+ {
+ vector winfs = hud_fontsize*2;
+ string victory_text = "Game over!";
+
+ if(active_minigame.minigame_flags & BD_TURN_WIN)
+ victory_text = "Well done! Click 'Next Level' to continue";
+
+ vector win_pos = pos+eY*(mySize_y-winfs_y)/2;
+ vector win_sz;
+ win_sz = minigame_drawcolorcodedstring_wrapped(mySize_x,win_pos,
+ sprintf("%s", victory_text),
+ winfs, 0, DRAWFLAG_NORMAL, 0.5);
+
+ drawfill(win_pos-eY*hud_fontsize_y,win_sz+2*eY*hud_fontsize_y,'0.3 0.3 1',0.8,DRAWFLAG_ADDITIVE);
+
+ minigame_drawcolorcodedstring_wrapped(mySize_x,win_pos,
+ sprintf("%s", victory_text),
+ winfs, panel_fg_alpha, DRAWFLAG_NORMAL, 0.5);
+ }
+}
+
+
+// Required function, draw the game status panel
+void bd_hud_status(vector pos, vector mySize)
+{
+ HUD_Panel_DrawBg(1);
+ vector ts;
+ ts = minigame_drawstring_wrapped(mySize_x,pos,active_minigame.descriptor.message,
+ hud_fontsize * 2, '0.25 0.47 0.72', panel_fg_alpha, DRAWFLAG_NORMAL,0.5);
+
+ pos_y += ts_y;
+ mySize_y -= ts_y;
+
+ vector player_fontsize = hud_fontsize * 1.75;
+ ts_y = ( mySize_y - 2*player_fontsize_y ) / BD_TEAMS;
+ ts_x = mySize_x;
+ vector mypos;
+ vector tile_size = '48 48 0';
+
+ mypos = pos;
+ drawfill(mypos,eX*mySize_x+eY*player_fontsize_y,'1 1 1',0.5,DRAWFLAG_ADDITIVE);
+ mypos_y += player_fontsize_y;
+ drawfill(mypos,eX*mySize_x+eY*tile_size_y,'1 1 1',0.25,DRAWFLAG_ADDITIVE);
+
+ entity e;
+ FOREACH_MINIGAME_ENTITY(e)
+ {
+ if ( e.classname == "minigame_player" )
+ {
+ mypos = pos;
+ minigame_drawcolorcodedstring_trunc(mySize_x,mypos,
+ GetPlayerName(e.minigame_playerslot-1),
+ player_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
+
+ mypos_y += player_fontsize_y;
+ string thepiece = "bd/dozer";
+ if(active_minigame.minigame_flags & BD_TURN_EDIT)
+ thepiece = bd_get_tile_pic(bd_curr_tile);
+ drawpic( mypos,
+ minigame_texture(thepiece),
+ tile_size * 0.7, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL );
+
+ mypos_x += tile_size_x;
+
+ drawstring(mypos,ftos(e.bd_moves),tile_size,
+ '0.7 0.84 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ }
+ }
+}
+
+// Turn a set of flags into a help message
+string bd_turn_to_string(int turnflags)
+{
+ if ( turnflags & BD_TURN_LOSS )
+ return _("Better luck next time!");
+
+ if ( turnflags & BD_TURN_WIN )
+ if(random() > 0.5)
+ return _("Tubular! Press \"Next Level\" to continue!");
+ else
+ return _("Wicked! Press \"Next Level\" to continue!");
+
+ if( turnflags & BD_TURN_EDIT )
+ return _("Press the space bar to change your currently selected tile");
+
+ if ( turnflags & BD_TURN_MOVE )
+ return _("Push the boulders onto the targets");
+
+ return "";
+}
+
+// Make the correct move
+void bd_make_move(entity minigame, string dir)
+{
+ if ( minigame.minigame_flags == BD_TURN_MOVE )
+ {
+ minigame_cmd("move ", dir);
+ }
+}
+
+void bd_editor_make_move(entity minigame, string dir)
+{
+ if ( minigame.minigame_flags == BD_TURN_EDIT )
+ {
+ minigame_cmd("move ", bd_curr_pos, " ", ftos(bd_curr_tile), " ", dir);
+ }
+}
+
+void bd_editor_fill(entity minigame)
+{
+ if ( minigame.minigame_flags == BD_TURN_EDIT )
+ {
+ minigame_cmd("fill ", bd_curr_pos, " ", ftos(bd_curr_tile));
+ }
+}
+
+void bd_set_curr_pos(string s)
+{
+ if ( bd_curr_pos )
+ strunzone(bd_curr_pos);
+ if ( s )
+ s = strzone(s);
+ bd_curr_pos = s;
+}
+
+bool bd_normal_move(entity minigame, int themove)
+{
+ switch ( themove )
+ {
+ case K_RIGHTARROW:
+ case K_KP_RIGHTARROW:
+ bd_make_move(minigame, "r");
+ return true;
+ case K_LEFTARROW:
+ case K_KP_LEFTARROW:
+ bd_make_move(minigame, "l");
+ return true;
+ case K_UPARROW:
+ case K_KP_UPARROW:
+ bd_make_move(minigame, "u");
+ return true;
+ case K_DOWNARROW:
+ case K_KP_DOWNARROW:
+ bd_make_move(minigame, "d");
+ return true;
+ }
+
+ return false;
+}
+
+bool bd_change_dozer_angle(entity minigame)
+{
+ entity dozer = bd_find_piece(minigame, bd_curr_pos, false);
+ if(!dozer || dozer.bd_tiletype != BD_TILE_DOZER)
+ return false;
+
+ string thedir = "";
+ vector dir = dozer.bd_dir;
+ if(dir.x == 0 && dir.y == 0) { thedir = "r"; }
+
+ if(dir.x == 0 && dir.y == 1) { thedir = "r"; }
+ if(dir.x == 0 && dir.y ==-1) { thedir = "l"; }
+ if(dir.x ==-1 && dir.y == 0) { thedir = "u"; }
+ if(dir.x == 1 && dir.y == 0) { thedir = "d"; }
+
+ bd_editor_make_move(minigame, thedir);
+ return true;
+}
+
+bool bd_editor_move(entity minigame, int themove)
+{
+ switch ( themove )
+ {
+ case K_RIGHTARROW:
+ case K_KP_RIGHTARROW:
+ if ( ! bd_curr_pos )
+ bd_set_curr_pos("a3");
+ else
+ bd_set_curr_pos(minigame_relative_tile(bd_curr_pos,1,0,BD_NUM_CNT,BD_LET_CNT));
+ return true;
+ case K_LEFTARROW:
+ case K_KP_LEFTARROW:
+ if ( ! bd_curr_pos )
+ bd_set_curr_pos("c3");
+ else
+ bd_set_curr_pos(minigame_relative_tile(bd_curr_pos,-1,0,BD_NUM_CNT,BD_LET_CNT));
+ return true;
+ case K_UPARROW:
+ case K_KP_UPARROW:
+ if ( ! bd_curr_pos )
+ bd_set_curr_pos("a1");
+ else
+ bd_set_curr_pos(minigame_relative_tile(bd_curr_pos,0,1,BD_NUM_CNT,BD_LET_CNT));
+ return true;
+ case K_DOWNARROW:
+ case K_KP_DOWNARROW:
+ if ( ! bd_curr_pos )
+ bd_set_curr_pos("a3");
+ else
+ bd_set_curr_pos(minigame_relative_tile(bd_curr_pos,0,-1,BD_NUM_CNT,BD_LET_CNT));
+ return true;
+ case K_ENTER:
+ case K_KP_ENTER:
+ bd_editor_make_move(minigame, "");
+ return true;
+ case K_SPACE:
+ if(bd_change_dozer_angle(minigame))
+ return true;
+ bd_curr_tile += 1;
+ if(bd_curr_tile > BD_TILE_LAST)
+ bd_curr_tile = 1;
+ return true;
+ }
+
+ return false;
+}
+
+// Required function, handle client events
+int bd_client_event(entity minigame, string event, ...)
+{
+ switch(event)
+ {
+ case "activate":
+ {
+ minigame.message = bd_turn_to_string(minigame.minigame_flags);
+ bd_set_curr_pos("");
+ bd_curr_tile = BD_TILE_BRICK1;
+ return false;
+ }
+ case "key_pressed":
+ {
+ if(minigame.minigame_flags & BD_TURN_MOVE)
+ {
+ if(bd_normal_move(minigame, ...(0,int)))
+ return true;
+ }
+
+ if(minigame.minigame_flags & BD_TURN_EDIT)
+ {
+ if(bd_editor_move(minigame, ...(0,int)))
+ return true;
+ }
+
+ return false;
+ }
+ case "mouse_pressed":
+ {
+ if(minigame.minigame_flags & BD_TURN_EDIT)
+ {
+ if(...(0,int) == K_MOUSE1)
+ {
+ bd_editor_make_move(minigame, "");
+ return true;
+ }
+
+ if(...(0,int) == K_MOUSE2)
+ {
+ bd_editor_fill(minigame);
+ return true;
+ }
+ }
+
+ return false;
+ }
+ case "mouse_moved":
+ {
+ if(minigame.minigame_flags & BD_TURN_EDIT)
+ {
+ vector mouse_pos = minigame_hud_normalize(mousepos,bd_boardpos,bd_boardsize);
+ bd_set_curr_pos(minigame_tile_name(mouse_pos,BD_LET_CNT,BD_NUM_CNT));
+ if ( ! bd_valid_tile(bd_curr_pos) )
+ bd_set_curr_pos("");
+ }
+ return true;
+ }
+ case "network_receive":
+ {
+ entity sent = ...(0,entity);
+ int sf = ...(1,int);
+ if ( sent.classname == "minigame" )
+ {
+ if ( sf & MINIG_SF_UPDATE )
+ {
+ sent.message = bd_turn_to_string(sent.minigame_flags);
+ //if ( sent.minigame_flags & minigame_self.team )
+ minigame_prompt();
+ }
+ }
+ else if(sent.classname == "minigame_board_piece")
+ {
+ if(sf & MINIG_SF_UPDATE)
+ {
+ int letter = ReadByte();
+ int number = ReadByte();
+ if(sent.netname) { strunzone(sent.netname); }
+ sent.netname = strzone(minigame_tile_buildname(letter, number));
+
+ sent.bd_tiletype = ReadByte();
+
+ int dx = ReadByte();
+ int dy = ReadByte();
+
+ if(dx == 2) dx = -1;
+ if(dy == 2) dy = -1;
+
+ sent.bd_dir_x = dx;
+ sent.bd_dir_y = dy;
+ sent.bd_dir_z = 0;
+ }
+ }
+ else if(sent.classname == "minigame_player" && (sf & BD_SF_PLAYERMOVES))
+ sent.bd_moves = ReadShort(); // make this a byte when possible
+
+ return false;
+ }
+ case "menu_show":
+ {
+ HUD_MinigameMenu_CustomEntry(...(0,entity),_("Next Level"),"next");
+ HUD_MinigameMenu_CustomEntry(...(0,entity),_("Restart"),"restart");
+ HUD_MinigameMenu_CustomEntry(...(0,entity),_("Editor"),"edit");
+ HUD_MinigameMenu_CustomEntry(...(0,entity),_("Save"),"save");
+ return false;
+ }
+ case "menu_click":
+ {
+ if(...(0,string) == "next")
+ minigame_cmd("next");
+ if(...(0,string) == "restart")
+ minigame_cmd("restart");
+ if(...(0,string) == "edit")
+ minigame_cmd("edit");
+ if(...(0,string) == "save")
+ minigame_cmd("save");
+ return false;
+ }
+ }
+
+ return false;
+}
+
+#endif
\ No newline at end of file
#define FIELD(Flags, Type,Name) if ( sf & (Flags) ) Write##Type(MSG_ENTITY, self.Name);
-#define WriteVector(to,Name) WriteCoord(to,Name##_x); WriteCoord(to,Name##_y); WriteCoord(to,Name##_z)
-#define WriteVector2D(to,Name) WriteCoord(to,Name##_x); WriteCoord(to,Name##_y)
#define MSLE(Name,Fields) \
else if ( self.classname == #Name ) { \
if ( sf & MINIG_SF_CREATE ) WriteString(MSG_ENTITY,self.owner.netname); \
bool minigame_SendEntity(entity this, entity to, int sf);
-REGISTRY(Minigames, BITS(3))
+REGISTRY(Minigames, BITS(4))
#define Minigames_from(i) _Minigames_from(i, NULL)
REGISTER_REGISTRY(Minigames)
REGISTRY_CHECK(Minigames)
#define REGISTER_MINIGAME(name,nicename) \
- REGISTER(Minigames, MINIGAME, name, m_id, new(minigame_descriptor)); \
+ REGISTER(Minigames, MINIGAME_##name, m_id, new(minigame_descriptor)); \
int name##_server_event(entity, string, ...); \
- REGISTER_INIT_POST(MINIGAME, name) { \
+ REGISTER_INIT_POST(MINIGAME_##name) { \
make_pure(this); \
this.netname = strzone(strtolower(#name)); \
this.message = nicename; \
this.minigame_event = name##_server_event; \
} \
- REGISTER_INIT(MINIGAME, name)
+ REGISTER_INIT(MINIGAME_##name)
#endif
Damage(head, self, self.realowner, (autocvar_g_monster_shambler_attack_lightning_damage_zap) * MONSTER_SKILLMOD(self), DEATH_MONSTER_SHAMBLER_ZAP.m_id, head.origin, '0 0 0');
}
- self.think = SUB_Remove;
+ self.think = SUB_Remove_self;
self.nextthink = time + 0.2;
}
}
else
{
- oldself.think = SUB_Remove;
+ oldself.think = SUB_Remove_self;
oldself.nextthink = time;
}
}
return true;
}
-void Monster_Reset()
-{SELFPARAM();
- setorigin(self, self.pos1);
- self.angles = self.pos2;
+void Monster_Reset(entity this)
+{
+ setorigin(this, this.pos1);
+ this.angles = this.pos2;
- Unfreeze(self); // remove any icy remains
+ Unfreeze(this); // remove any icy remains
- self.health = self.max_health;
- self.velocity = '0 0 0';
- self.enemy = world;
- self.goalentity = world;
- self.attack_finished_single[0] = 0;
- self.moveto = self.origin;
+ this.health = this.max_health;
+ this.velocity = '0 0 0';
+ this.enemy = world;
+ this.goalentity = world;
+ this.attack_finished_single[0] = 0;
+ this.moveto = this.origin;
}
void Monster_Dead_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
// number of monsters spawned with mobspawn command
totalspawned -= 1;
- self.think = SUB_Remove;
+ self.think = SUB_Remove_self;
self.nextthink = time + 0.1;
self.event_damage = func_null;
}
{
Violence_GibSplash(self, 1, 0.5, attacker);
- self.think = SUB_Remove;
+ self.think = SUB_Remove_self;
self.nextthink = time + 0.1;
}
}
REGISTRY_CHECK(Buffs)
#define REGISTER_BUFF(id) \
- REGISTER(Buffs, BUFF, id, m_id, NEW(Buff)); \
- REGISTER_INIT_POST(BUFF, id) { \
+ REGISTER(Buffs, BUFF_##id, m_id, NEW(Buff)); \
+ REGISTER_INIT_POST(BUFF_##id) { \
this.netname = this.m_name; \
this.m_itemid = BIT(this.m_id - 1); \
this.m_sprite = strzone(strcat("buff-", this.m_name)); \
} \
- REGISTER_INIT(BUFF, id)
+ REGISTER_INIT(BUFF_##id)
#include "../../../items/item/pickup.qh"
CLASS(Buff, Pickup)
if(self.buff_activetime) { buff_Waypoint_Spawn(self); }
}
-void buff_Reset()
-{SELFPARAM();
+void buff_Reset(entity this)
+{
if(autocvar_g_buffs_randomize)
- buff_NewType(self, self.buffs);
- self.owner = world;
+ buff_NewType(this, this.buffs);
+ this.owner = world;
buff_SetCooldown(autocvar_g_buffs_cooldown_activate);
buff_Waypoint_Reset();
- self.buff_activetime_updated = false;
+ this.buff_activetime_updated = false;
- if(autocvar_g_buffs_random_location || (self.spawnflags & 64))
- buff_Respawn(self);
+ if(autocvar_g_buffs_random_location || (this.spawnflags & 64))
+ buff_Respawn(this);
}
float buff_Customize()
void instagib_extralife()
{SELFPARAM();
- self.max_health = 1;
StartItem(this, ITEM_ExtraLife);
}
return MUT_ITEMTOUCH_CONTINUE;
}
- if(self.max_health)
+ if(self.itemdef == ITEM_ExtraLife)
{
other.armorvalue = bound(other.armorvalue, 999, other.armorvalue + autocvar_g_instagib_extralives);
Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_EXTRALIVES);
fn.colormod = Nades_from(n.nade_type).m_color;
fn.colormap = self.colormap;
fn.glowmod = self.glowmod;
- fn.think = SUB_Remove;
+ fn.think = SUB_Remove_self;
fn.nextthink = n.wait;
self.nade = n;
return false;
}
-void _spawnfunc_weapon_hmg() { SELFPARAM(); spawnfunc_weapon_hmg(this); }
-void _spawnfunc_weapon_rpc() { SELFPARAM(); spawnfunc_weapon_rpc(this); }
+void self_spawnfunc_weapon_hmg() { SELFPARAM(); spawnfunc_weapon_hmg(this); }
+void self_spawnfunc_weapon_rpc() { SELFPARAM(); spawnfunc_weapon_rpc(this); }
MUTATOR_HOOKFUNCTION(ok, OnEntityPreSpawn)
{SELFPARAM();
wep.team = self.team;
wep.respawntime = autocvar_g_overkill_superguns_respawn_time;
wep.pickup_anyway = true;
- wep.think = _spawnfunc_weapon_hmg;
+ wep.think = self_spawnfunc_weapon_hmg;
wep.nextthink = time + 0.1;
return true;
}
wep.team = self.team;
wep.respawntime = autocvar_g_overkill_superguns_respawn_time;
wep.pickup_anyway = true;
- wep.think = _spawnfunc_weapon_rpc;
+ wep.think = self_spawnfunc_weapon_rpc;
wep.nextthink = time + 0.1;
return true;
}
if(_notes.alpha <= time)
{
- _notes.think = SUB_Remove;
+ _notes.think = SUB_Remove_self;
_notes.nextthink = time;
}
}
}
-void func_breakable_reset()
-{SELFPARAM();
- self.team = self.team_saved;
+void func_breakable_reset(entity this)
+{
+ this.team = this.team_saved;
func_breakable_look_restore();
- if(self.spawnflags & 1)
+ if(this.spawnflags & 1)
func_breakable_behave_destroyed();
else
func_breakable_behave_restore();
- CSQCMODEL_AUTOUPDATE(self);
+ CSQCMODEL_AUTOUPDATE(this);
}
// destructible walls that can be used to trigger target_objective_decrease
spawnfunc(func_breakable)
{
float n, i;
- if(!self.health)
- self.health = 100;
- self.max_health = self.health;
+ if(!this.health)
+ this.health = 100;
+ this.max_health = this.health;
// yes, I know, MOVETYPE_NONE is not available here, not that one would want it here anyway
- if(!self.debrismovetype) self.debrismovetype = MOVETYPE_BOUNCE;
- if(!self.debrissolid) self.debrissolid = SOLID_NOT;
- if(self.debrisvelocity == '0 0 0') self.debrisvelocity = '0 0 140';
- if(self.debrisvelocityjitter == '0 0 0') self.debrisvelocityjitter = '70 70 70';
- if(self.debrisavelocityjitter == '0 0 0') self.debrisavelocityjitter = '600 600 600';
- if(!self.debristime) self.debristime = 3.5;
- if(!self.debristimejitter) self.debristime = 2.5;
-
- if(self.mdl != "")
- self.cnt = _particleeffectnum(self.mdl);
- if(self.count == 0)
- self.count = 1;
-
- if(self.message == "")
- self.message = "got too close to an explosion";
- if(self.message2 == "")
- self.message2 = "was pushed into an explosion by";
- if(!self.dmg_radius)
- self.dmg_radius = 150;
- if(!self.dmg_force)
- self.dmg_force = 200;
-
- self.mdl = self.model;
+ if(!this.debrismovetype) this.debrismovetype = MOVETYPE_BOUNCE;
+ if(!this.debrissolid) this.debrissolid = SOLID_NOT;
+ if(this.debrisvelocity == '0 0 0') this.debrisvelocity = '0 0 140';
+ if(this.debrisvelocityjitter == '0 0 0') this.debrisvelocityjitter = '70 70 70';
+ if(this.debrisavelocityjitter == '0 0 0') this.debrisavelocityjitter = '600 600 600';
+ if(!this.debristime) this.debristime = 3.5;
+ if(!this.debristimejitter) this.debristime = 2.5;
+
+ if(this.mdl != "")
+ this.cnt = _particleeffectnum(this.mdl);
+ if(this.count == 0)
+ this.count = 1;
+
+ if(this.message == "")
+ this.message = "got too close to an explosion";
+ if(this.message2 == "")
+ this.message2 = "was pushed into an explosion by";
+ if(!this.dmg_radius)
+ this.dmg_radius = 150;
+ if(!this.dmg_force)
+ this.dmg_force = 200;
+
+ this.mdl = this.model;
SetBrushEntityModel();
- if(self.spawnflags & 4)
- self.use = func_breakable_destroy;
+ if(this.spawnflags & 4)
+ this.use = func_breakable_destroy;
else
- self.use = func_breakable_restore;
+ this.use = func_breakable_restore;
- if(self.spawnflags & 4)
+ if(this.spawnflags & 4)
{
- self.takedamage = DAMAGE_NO;
- self.event_damage = func_null;
- self.bot_attack = false;
+ this.takedamage = DAMAGE_NO;
+ this.event_damage = func_null;
+ this.bot_attack = false;
}
// precache all the models
- if (self.mdl_dead)
- precache_model(self.mdl_dead);
- n = tokenize_console(self.debris);
+ if (this.mdl_dead)
+ precache_model(this.mdl_dead);
+ n = tokenize_console(this.debris);
for(i = 0; i < n; ++i)
precache_model(argv(i));
- if(self.noise)
- precache_sound(self.noise);
- if(self.noise1)
- precache_sound(self.noise1);
+ if(this.noise)
+ precache_sound(this.noise);
+ if(this.noise1)
+ precache_sound(this.noise1);
- self.team_saved = self.team;
- self.dropped_origin = self.origin;
+ this.team_saved = this.team;
+ this.dropped_origin = this.origin;
- self.reset = func_breakable_reset;
- func_breakable_reset();
+ this.reset = func_breakable_reset;
+ this.reset(this);
- self.init_for_player_needed = 1;
- self.init_for_player = func_breakable_init_for_player;
+ this.init_for_player_needed = 1;
+ this.init_for_player = func_breakable_init_for_player;
- CSQCMODEL_AUTOINIT(self);
+ CSQCMODEL_AUTOINIT(this);
}
// for use in maps with a "model" key set
self.SendFlags |= 2;
}
-void conveyor_reset()
-{SELFPARAM();
- self.state = (self.spawnflags & 1);
+void conveyor_reset(entity this)
+{
+ this.state = (this.spawnflags & 1);
- self.SendFlags |= 2;
+ this.SendFlags |= 2;
}
bool conveyor_send(entity this, entity to, int sf)
void conveyor_init()
{SELFPARAM();
- if (!self.speed)
- self.speed = 200;
- self.movedir = self.movedir * self.speed;
- self.think = conveyor_think;
- self.nextthink = time;
+ if (!this.speed) this.speed = 200;
+ this.movedir *= this.speed;
+ this.think = conveyor_think;
+ this.nextthink = time;
IFTARGETED
{
- self.use = conveyor_use;
- self.reset = conveyor_reset;
- conveyor_reset();
+ this.use = conveyor_use;
+ this.reset = conveyor_reset;
+ this.reset(this);
}
else
- self.state = 1;
+ this.state = 1;
- FixSize(self);
+ FixSize(this);
- Net_LinkEntity(self, 0, false, conveyor_send);
+ Net_LinkEntity(this, 0, false, conveyor_send);
- self.SendFlags |= 1;
+ this.SendFlags |= 1;
}
spawnfunc(trigger_conveyor)
#endif
}
-void door_reset()
-{SELFPARAM();
- SUB_SETORIGIN(self, self.pos1);
- self.SUB_VELOCITY = '0 0 0';
- self.state = STATE_BOTTOM;
- self.SUB_THINK = func_null;
- self.SUB_NEXTTHINK = 0;
+void door_reset(entity this)
+{
+ SUB_SETORIGIN(this, this.pos1);
+ this.SUB_VELOCITY = '0 0 0';
+ this.state = STATE_BOTTOM;
+ this.SUB_THINK = func_null;
+ this.SUB_NEXTTHINK = 0;
#ifdef SVQC
- self.SendFlags |= SF_TRIGGER_RESET;
+ this.SendFlags |= SF_TRIGGER_RESET;
#endif
}
if(sf & SF_TRIGGER_INIT)
{
- self.classname = strzone(ReadString());
- self.spawnflags = ReadByte();
+ this.classname = strzone(ReadString());
+ this.spawnflags = ReadByte();
- self.mdl = strzone(ReadString());
- _setmodel(self, self.mdl);
+ this.mdl = strzone(ReadString());
+ _setmodel(this, this.mdl);
trigger_common_read(true);
- self.pos1_x = ReadCoord();
- self.pos1_y = ReadCoord();
- self.pos1_z = ReadCoord();
- self.pos2_x = ReadCoord();
- self.pos2_y = ReadCoord();
- self.pos2_z = ReadCoord();
-
- self.size_x = ReadCoord();
- self.size_y = ReadCoord();
- self.size_z = ReadCoord();
-
- self.wait = ReadShort();
- self.speed = ReadShort();
- self.lip = ReadByte();
- self.state = ReadByte();
- self.SUB_LTIME = ReadCoord();
-
- self.solid = SOLID_BSP;
- self.movetype = MOVETYPE_PUSH;
- self.trigger_touch = door_touch;
- self.draw = door_draw;
- self.drawmask = MASK_NORMAL;
- self.use = door_use;
+ vector v;
+
+ v.x = ReadCoord();
+ v.y = ReadCoord();
+ v.z = ReadCoord();
+ this.pos1 = v;
+
+ v.x = ReadCoord();
+ v.y = ReadCoord();
+ v.z = ReadCoord();
+ this.pos2 = v;
+
+ v.x = ReadCoord();
+ v.y = ReadCoord();
+ v.z = ReadCoord();
+ this.size = v;
+
+ this.wait = ReadShort();
+ this.speed = ReadShort();
+ this.lip = ReadByte();
+ this.state = ReadByte();
+ this.SUB_LTIME = ReadCoord();
+
+ this.solid = SOLID_BSP;
+ this.movetype = MOVETYPE_PUSH;
+ this.trigger_touch = door_touch;
+ this.draw = door_draw;
+ this.drawmask = MASK_NORMAL;
+ this.use = door_use;
LinkDoors();
- if(self.spawnflags & DOOR_START_OPEN)
+ if(this.spawnflags & DOOR_START_OPEN)
door_init_startopen();
- self.move_time = time;
- self.move_origin = self.origin;
- self.move_movetype = MOVETYPE_PUSH;
- self.move_angles = self.angles;
- self.move_blocked = door_blocked;
+ this.move_time = time;
+ this.move_origin = this.origin;
+ this.move_movetype = MOVETYPE_PUSH;
+ this.move_angles = this.angles;
+ this.move_blocked = door_blocked;
}
if(sf & SF_TRIGGER_RESET)
{
- door_reset();
+ door_reset(this);
}
if(sf & SF_TRIGGER_UPDATE)
{
- self.origin_x = ReadCoord();
- self.origin_y = ReadCoord();
- self.origin_z = ReadCoord();
- setorigin(self, self.origin);
- self.move_origin = self.origin;
-
- self.pos1_x = ReadCoord();
- self.pos1_y = ReadCoord();
- self.pos1_z = ReadCoord();
- self.pos2_x = ReadCoord();
- self.pos2_y = ReadCoord();
- self.pos2_z = ReadCoord();
+ this.origin_x = ReadCoord();
+ this.origin_y = ReadCoord();
+ this.origin_z = ReadCoord();
+ setorigin(this, this.origin);
+ this.move_origin = this.origin;
+
+ this.pos1_x = ReadCoord();
+ this.pos1_y = ReadCoord();
+ this.pos1_z = ReadCoord();
+ this.pos2_x = ReadCoord();
+ this.pos2_y = ReadCoord();
+ this.pos2_z = ReadCoord();
}
return true;
}
FIXME: only one sound set available at the time being
*/
-void door_rotating_reset()
-{SELFPARAM();
- self.angles = self.pos1;
- self.avelocity = '0 0 0';
- self.state = STATE_BOTTOM;
- self.think = func_null;
- self.nextthink = 0;
+void door_rotating_reset(entity this)
+{
+ this.angles = this.pos1;
+ this.avelocity = '0 0 0';
+ this.state = STATE_BOTTOM;
+ this.think = func_null;
+ this.nextthink = 0;
}
void door_rotating_init_startopen()
}
}
-void secret_reset()
-{SELFPARAM();
- if (self.spawnflags&SECRET_YES_SHOOT)
+void secret_reset(entity this)
+{
+ if (this.spawnflags & SECRET_YES_SHOOT)
{
- self.health = 10000;
- self.takedamage = DAMAGE_YES;
+ this.health = 10000;
+ this.takedamage = DAMAGE_YES;
}
- setorigin(self, self.oldorigin);
- self.think = func_null;
- self.SUB_NEXTTHINK = 0;
+ setorigin(this, this.oldorigin);
+ this.think = func_null;
+ this.SUB_NEXTTHINK = 0;
}
/*QUAKED spawnfunc_func_door_secret (0 .5 .8) ? open_once 1st_left 1st_down no_shoot always_shoot
spawnfunc(func_door_secret)
{
- /*if (!self.deathtype) // map makers can override this
- self.deathtype = " got in the way";*/
+ /*if (!this.deathtype) // map makers can override this
+ this.deathtype = " got in the way";*/
- if (!self.dmg)
- self.dmg = 2;
+ if (!this.dmg) this.dmg = 2;
// Magic formula...
- self.mangle = self.angles;
- self.angles = '0 0 0';
- self.classname = "door";
- if (!InitMovingBrushTrigger())
- return;
- self.effects |= EF_LOWPRECISION;
-
- if(self.noise == "")
- self.noise = "misc/talk.wav";
- precache_sound(self.noise);
-
- self.touch = secret_touch;
- self.blocked = secret_blocked;
- self.speed = 50;
- self.use = fd_secret_use;
+ this.mangle = this.angles;
+ this.angles = '0 0 0';
+ this.classname = "door";
+ if (!InitMovingBrushTrigger()) return;
+ this.effects |= EF_LOWPRECISION;
+
+ if (this.noise == "") this.noise = "misc/talk.wav";
+ precache_sound(this.noise);
+
+ this.touch = secret_touch;
+ this.blocked = secret_blocked;
+ this.speed = 50;
+ this.use = fd_secret_use;
IFTARGETED
{
}
else
- self.spawnflags |= SECRET_YES_SHOOT;
+ this.spawnflags |= SECRET_YES_SHOOT;
- if(self.spawnflags&SECRET_YES_SHOOT)
+ if (this.spawnflags & SECRET_YES_SHOOT)
{
- self.health = 10000;
- self.takedamage = DAMAGE_YES;
- self.event_damage = fd_secret_damage;
+ this.health = 10000;
+ this.takedamage = DAMAGE_YES;
+ this.event_damage = fd_secret_damage;
}
- self.oldorigin = self.origin;
- if (!self.wait)
- self.wait = 5; // 5 seconds before closing
+ this.oldorigin = this.origin;
+ if (!this.wait) this.wait = 5; // seconds before closing
- self.reset = secret_reset;
- secret_reset();
+ this.reset = secret_reset;
+ this.reset(this);
}
#endif
spawnfunc(func_plat)
{
- if (self.sounds == 0)
- self.sounds = 2;
+ if (this.sounds == 0) this.sounds = 2;
- if(self.spawnflags & 4)
- self.dmg = 10000;
+ if (this.spawnflags & 4) this.dmg = 10000;
- if(self.dmg && (self.message == ""))
- self.message = "was squished";
- if(self.dmg && (self.message2 == ""))
- self.message2 = "was squished by";
+ if (this.dmg && (this.message == "")) this.message = "was squished";
+ if (this.dmg && (this.message2 == "")) this.message2 = "was squished by";
- if (self.sounds == 1)
+ if (this.sounds == 1)
{
precache_sound ("plats/plat1.wav");
precache_sound ("plats/plat2.wav");
- self.noise = "plats/plat1.wav";
- self.noise1 = "plats/plat2.wav";
+ this.noise = "plats/plat1.wav";
+ this.noise1 = "plats/plat2.wav";
}
- if (self.sounds == 2)
+ if (this.sounds == 2)
{
precache_sound ("plats/medplat1.wav");
precache_sound ("plats/medplat2.wav");
- self.noise = "plats/medplat1.wav";
- self.noise1 = "plats/medplat2.wav";
+ this.noise = "plats/medplat1.wav";
+ this.noise1 = "plats/medplat2.wav";
}
- if (self.sound1)
+ if (this.sound1)
{
- precache_sound (self.sound1);
- self.noise = self.sound1;
+ precache_sound (this.sound1);
+ this.noise = this.sound1;
}
- if (self.sound2)
+ if (this.sound2)
{
- precache_sound (self.sound2);
- self.noise1 = self.sound2;
+ precache_sound (this.sound2);
+ this.noise1 = this.sound2;
}
- self.mangle = self.angles;
- self.angles = '0 0 0';
+ this.mangle = this.angles;
+ this.angles = '0 0 0';
- self.classname = "plat";
+ this.classname = "plat";
if (!InitMovingBrushTrigger())
return;
- self.effects |= EF_LOWPRECISION;
- setsize (self, self.mins , self.maxs);
+ this.effects |= EF_LOWPRECISION;
+ setsize (this, this.mins , this.maxs);
- self.blocked = plat_crush;
+ this.blocked = plat_crush;
- if (!self.speed)
- self.speed = 150;
- if (!self.lip)
- self.lip = 16;
- if (!self.height)
- self.height = self.size_z - self.lip;
+ if (!this.speed) this.speed = 150;
+ if (!this.lip) this.lip = 16;
+ if (!this.height) this.height = this.size.z - this.lip;
- self.pos1 = self.origin;
- self.pos2 = self.origin;
- self.pos2_z = self.origin_z - self.height;
+ this.pos1 = this.origin;
+ this.pos2 = this.origin;
+ this.pos2_z = this.origin.z - this.height;
- self.reset = plat_reset;
- plat_reset();
+ this.reset = plat_reset;
+ this.reset(this);
- InitializeEntity(self, plat_delayedinit, INITPRIO_FINDTARGET);
+ InitializeEntity(this, plat_delayedinit, INITPRIO_FINDTARGET);
}
#elif defined(CSQC)
void plat_draw(entity this)
if(sf & SF_TRIGGER_INIT)
{
- self.platmovetype_start = ReadByte();
- self.platmovetype_turn = ReadByte();
- self.platmovetype_end = ReadByte();
- self.spawnflags = ReadByte();
+ this.platmovetype_start = ReadByte();
+ this.platmovetype_turn = ReadByte();
+ this.platmovetype_end = ReadByte();
+ this.spawnflags = ReadByte();
- self.model = strzone(ReadString());
- _setmodel(self, self.model);
+ this.model = strzone(ReadString());
+ _setmodel(this, this.model);
trigger_common_read(true);
- self.pos1_x = ReadCoord();
- self.pos1_y = ReadCoord();
- self.pos1_z = ReadCoord();
- self.pos2_x = ReadCoord();
- self.pos2_y = ReadCoord();
- self.pos2_z = ReadCoord();
+ this.pos1_x = ReadCoord();
+ this.pos1_y = ReadCoord();
+ this.pos1_z = ReadCoord();
+ this.pos2_x = ReadCoord();
+ this.pos2_y = ReadCoord();
+ this.pos2_z = ReadCoord();
- self.size_x = ReadCoord();
- self.size_y = ReadCoord();
- self.size_z = ReadCoord();
+ this.size_x = ReadCoord();
+ this.size_y = ReadCoord();
+ this.size_z = ReadCoord();
- self.mangle_x = ReadAngle();
- self.mangle_y = ReadAngle();
- self.mangle_z = ReadAngle();
+ this.mangle_x = ReadAngle();
+ this.mangle_y = ReadAngle();
+ this.mangle_z = ReadAngle();
- self.speed = ReadShort();
- self.height = ReadShort();
- self.lip = ReadByte();
- self.state = ReadByte();
+ this.speed = ReadShort();
+ this.height = ReadShort();
+ this.lip = ReadByte();
+ this.state = ReadByte();
- self.dmg = ReadShort();
+ this.dmg = ReadShort();
- self.classname = "plat";
- self.solid = SOLID_BSP;
- self.movetype = MOVETYPE_PUSH;
- self.drawmask = MASK_NORMAL;
- self.draw = plat_draw;
- self.use = plat_use;
- self.entremove = trigger_remove_generic;
+ this.classname = "plat";
+ this.solid = SOLID_BSP;
+ this.movetype = MOVETYPE_PUSH;
+ this.drawmask = MASK_NORMAL;
+ this.draw = plat_draw;
+ this.use = plat_use;
+ this.entremove = trigger_remove_generic;
- plat_reset(); // also called here
+ plat_reset(this); // also called here
- self.move_movetype = MOVETYPE_PUSH;
- self.move_origin = self.origin;
- self.move_angles = self.angles;
- self.move_time = time;
+ this.move_movetype = MOVETYPE_PUSH;
+ this.move_origin = this.origin;
+ this.move_angles = this.angles;
+ this.move_time = time;
plat_spawn_inside_trigger();
}
if(sf & SF_TRIGGER_RESET)
{
- plat_reset();
+ plat_reset(this);
- self.move_origin = self.origin;
- self.move_angles = self.angles;
- self.move_time = time;
+ this.move_origin = this.origin;
+ this.move_angles = this.angles;
+ this.move_time = time;
}
return true;
}
self.nextthink = time;
}
-void pointparticles_reset()
-{SELFPARAM();
- if(self.spawnflags & 1)
- self.state = 1;
+void pointparticles_reset(entity this)
+{
+ if(this.spawnflags & 1)
+ this.state = 1;
else
- self.state = 0;
+ this.state = 0;
}
spawnfunc(func_pointparticles)
{
- if(self.model != "")
- _setmodel(self, self.model);
- if(self.noise != "")
- precache_sound (self.noise);
+ if(this.model != "") _setmodel(this, this.model);
+ if(this.noise != "") precache_sound(this.noise);
- if(!self.bgmscriptsustain)
- self.bgmscriptsustain = 1;
- else if(self.bgmscriptsustain < 0)
- self.bgmscriptsustain = 0;
+ if(!this.bgmscriptsustain) this.bgmscriptsustain = 1;
+ else if(this.bgmscriptsustain < 0) this.bgmscriptsustain = 0;
- if(!self.atten)
- self.atten = ATTEN_NORM;
- else if(self.atten < 0)
- self.atten = 0;
- if(!self.volume)
- self.volume = 1;
- if(!self.count)
- self.count = 1;
- if(!self.impulse)
- self.impulse = 1;
+ if(!this.atten) this.atten = ATTEN_NORM;
+ else if(this.atten < 0) this.atten = 0;
+ if(!this.volume) this.volume = 1;
+ if(!this.count) this.count = 1;
+ if(!this.impulse) this.impulse = 1;
- if(!self.modelindex)
+ if(!this.modelindex)
{
- setorigin(self, self.origin + self.mins);
- setsize(self, '0 0 0', self.maxs - self.mins);
+ setorigin(this, this.origin + this.mins);
+ setsize(this, '0 0 0', this.maxs - this.mins);
}
- if(!self.cnt)
- self.cnt = _particleeffectnum(self.mdl);
+ if(!this.cnt) this.cnt = _particleeffectnum(this.mdl);
- Net_LinkEntity(self, (self.spawnflags & 4), 0, pointparticles_SendEntity);
+ Net_LinkEntity(this, (this.spawnflags & 4), 0, pointparticles_SendEntity);
IFTARGETED
{
- self.use = pointparticles_use;
- self.reset = pointparticles_reset;
- self.reset();
+ this.use = pointparticles_use;
+ this.reset = pointparticles_reset;
+ this.reset(this);
}
else
- self.state = 1;
- self.think = pointparticles_think;
- self.nextthink = time;
+ this.state = 1;
+ this.think = pointparticles_think;
+ this.nextthink = time;
}
spawnfunc(func_sparks)
misc_laser_aim();
}
-void laser_reset()
-{SELFPARAM();
- if(self.spawnflags & 1)
- self.state = 1;
+void laser_reset(entity this)
+{
+ if(this.spawnflags & 1)
+ this.state = 1;
else
- self.state = 0;
+ this.state = 0;
}
spawnfunc(misc_laser)
{
- if(self.mdl)
+ if(this.mdl)
{
- if(self.mdl == "none")
- self.cnt = -1;
+ if(this.mdl == "none")
+ this.cnt = -1;
else
{
- self.cnt = _particleeffectnum(self.mdl);
- if(self.cnt < 0)
- if(self.dmg)
- self.cnt = particleeffectnum(EFFECT_LASER_DEADLY);
+ this.cnt = _particleeffectnum(this.mdl);
+ if(this.cnt < 0 && this.dmg)
+ this.cnt = particleeffectnum(EFFECT_LASER_DEADLY);
}
}
- else if(!self.cnt)
+ else if(!this.cnt)
{
- if(self.dmg)
- self.cnt = particleeffectnum(EFFECT_LASER_DEADLY);
+ if(this.dmg)
+ this.cnt = particleeffectnum(EFFECT_LASER_DEADLY);
else
- self.cnt = -1;
+ this.cnt = -1;
}
- if(self.cnt < 0)
- self.cnt = -1;
+ if(this.cnt < 0)
+ this.cnt = -1;
- if(self.colormod == '0 0 0')
- if(!self.alpha)
- self.colormod = '1 0 0';
- if(self.message == "")
- self.message = "saw the light";
- if (self.message2 == "")
- self.message2 = "was pushed into a laser by";
- if(!self.scale)
- self.scale = 1;
- if(!self.modelscale)
- self.modelscale = 1;
- else if(self.modelscale < 0)
- self.modelscale = 0;
- self.think = misc_laser_think;
- self.nextthink = time;
- InitializeEntity(self, misc_laser_init, INITPRIO_FINDTARGET);
+ if(this.colormod == '0 0 0')
+ if(!this.alpha)
+ this.colormod = '1 0 0';
+ if(this.message == "") this.message = "saw the light";
+ if (this.message2 == "") this.message2 = "was pushed into a laser by";
+ if(!this.scale) this.scale = 1;
+ if(!this.modelscale) this.modelscale = 1;
+ else if(this.modelscale < 0) this.modelscale = 0;
+ this.think = misc_laser_think;
+ this.nextthink = time;
+ InitializeEntity(this, misc_laser_init, INITPRIO_FINDTARGET);
- self.mangle = self.angles;
+ this.mangle = this.angles;
- Net_LinkEntity(self, false, 0, laser_SendEntity);
+ Net_LinkEntity(this, false, 0, laser_SendEntity);
IFTARGETED
{
- self.reset = laser_reset;
- laser_reset();
- self.use = laser_use;
+ this.reset = laser_reset;
+ this.reset(this);
+ this.use = laser_use;
}
else
- self.state = 1;
+ this.state = 1;
}
#elif defined(CSQC)
.string sound1, sound2;
-void plat_reset()
-{SELFPARAM();
+void plat_reset(entity this)
+{
IFTARGETED
{
- setorigin (self, self.pos1);
- self.state = 4;
- self.use = plat_use;
+ setorigin (this, this.pos1);
+ this.state = 4;
+ this.use = plat_use;
}
else
{
- setorigin (self, self.pos2);
- self.state = 2;
- self.use = plat_trigger_use;
+ setorigin (this, this.pos2);
+ this.state = 2;
+ this.use = plat_trigger_use;
}
#ifdef SVQC
- self.SendFlags |= SF_TRIGGER_RESET;
+ this.SendFlags |= SF_TRIGGER_RESET;
#endif
}
#endif
-void SUB_Remove();
void SUB_SetFade (entity ent, float when, float fading_time);
void SUB_VanishOrRemove (entity ent);
WriteByte(to, self.lifetime);
WriteString(to, self.noise);
}
-void target_music_reset()
-{SELFPARAM();
- if(self.targetname == "")
- target_music_sendto(MSG_ALL, 1);
+void target_music_reset(entity this)
+{
+ if (this.targetname == "") target_music_sendto(MSG_ALL, 1);
}
void target_music_kill()
{
}
return 1;
}
-void trigger_music_reset()
-{SELFPARAM();
- self.cnt = !(self.spawnflags & 1);
- self.SendFlags |= 0x80;
+void trigger_music_reset(entity this)
+{
+ this.cnt = !(this.spawnflags & 1);
+ this.SendFlags |= 0x80;
}
void trigger_music_use()
{SELFPARAM();
}
spawnfunc(trigger_music)
{
- if(self.model != "")
- _setmodel(self, self.model);
- if(!self.volume)
- self.volume = 1;
- if(!self.modelindex)
+ if(this.model != "") _setmodel(this, this.model);
+ if(!this.volume) this.volume = 1;
+ if(!this.modelindex)
{
- setorigin(self, self.origin + self.mins);
- setsize(self, '0 0 0', self.maxs - self.mins);
+ setorigin(this, this.origin + this.mins);
+ setsize(this, '0 0 0', this.maxs - this.mins);
}
- trigger_music_reset();
+ trigger_music_reset(this);
- self.use = trigger_music_use;
- self.reset = trigger_music_reset;
+ this.use = trigger_music_use;
+ this.reset = trigger_music_reset;
- Net_LinkEntity(self, false, 0, trigger_music_SendEntity);
+ Net_LinkEntity(this, false, 0, trigger_music_SendEntity);
}
#elif defined(CSQC)
sound(self, CH_TRIGGER_SINGLE, SND_Null, VOL_BASE * self.volume, self.atten);
self.use = target_speaker_use_on;
}
-void target_speaker_reset()
-{SELFPARAM();
- if(self.spawnflags & 1) // LOOPED_ON
+void target_speaker_reset(entity this)
+{
+ if(this.spawnflags & 1) // LOOPED_ON
{
- if(self.use == target_speaker_use_on)
+ if(this.use == target_speaker_use_on)
target_speaker_use_on();
}
- else if(self.spawnflags & 2)
+ else if(this.spawnflags & 2)
{
- if(self.use == target_speaker_use_off)
+ if(this.use == target_speaker_use_off)
target_speaker_use_off();
}
}
}
}
-void counter_reset()
-{SELFPARAM();
- self.count = self.cnt;
- multi_reset();
+void counter_reset(entity this)
+{
+ this.count = this.cnt;
+ multi_reset(this);
}
/*QUAKED spawnfunc_trigger_counter (.5 .5 .5) ? nomessage
self.nextthink = self.wait;
}
-void delay_reset()
-{SELFPARAM();
- self.think = func_null;
- self.nextthink = 0;
+void delay_reset(entity this)
+{
+ this.think = func_null;
+ this.nextthink = 0;
}
spawnfunc(trigger_delay)
SUB_UseTargets();
}
-void _spawnfunc_trigger_flipflop();
spawnfunc(trigger_flipflop)
{
- if(self.spawnflags & 1)
- self.state = 1;
- self.use = flipflop_use;
- self.reset = _spawnfunc_trigger_flipflop; // perfect resetter
+ if(this.spawnflags & 1)
+ this.state = 1;
+ this.use = flipflop_use;
+ this.reset = spawnfunc_trigger_flipflop; // perfect resetter
}
-void _spawnfunc_trigger_flipflop() { SELFPARAM(); spawnfunc_trigger_flipflop(this); }
#endif
remove(self);
}
-void _spawnfunc_trigger_gamestart();
+void self_spawnfunc_trigger_gamestart();
spawnfunc(trigger_gamestart)
{
- self.use = gamestart_use;
- self.reset2 = _spawnfunc_trigger_gamestart;
+ this.use = gamestart_use;
+ this.reset2 = self_spawnfunc_trigger_gamestart;
- if(self.wait)
+ if(this.wait)
{
- self.think = self.use;
- self.nextthink = game_starttime + self.wait;
+ this.think = this.use;
+ this.nextthink = game_starttime + this.wait;
}
else
- InitializeEntity(self, gamestart_use, INITPRIO_FINDTARGET);
+ InitializeEntity(this, gamestart_use, INITPRIO_FINDTARGET);
}
-void _spawnfunc_trigger_gamestart() { SELFPARAM(); spawnfunc_trigger_gamestart(this); }
+void self_spawnfunc_trigger_gamestart() { SELFPARAM(); spawnfunc_trigger_gamestart(this); }
#endif
void trigger_push_touch()
{SELFPARAM();
- if (self.active == ACTIVE_NOT)
+ if (this.active == ACTIVE_NOT)
return;
#ifdef SVQC
return;
#endif
- if(self.team)
- if(((self.spawnflags & 4) == 0) == (DIFF_TEAM(self, other)))
+ if(this.team)
+ if(((this.spawnflags & 4) == 0) == (DIFF_TEAM(this, other)))
return;
EXACTTRIGGER_TOUCH;
- if(self.enemy)
+ if(this.enemy)
{
- other.velocity = trigger_push_calculatevelocity(other.origin, self.enemy, self.height);
+ other.velocity = trigger_push_calculatevelocity(other.origin, this.enemy, this.height);
other.move_velocity = other.velocity;
}
- else if(self.target)
+ else if(this.target)
{
entity e;
RandomSelection_Init();
- for(e = world; (e = find(e, targetname, self.target)); )
+ for(e = world; (e = find(e, targetname, this.target)); )
{
if(e.cnt)
RandomSelection_Add(e, 0, string_null, e.cnt, 1);
else
RandomSelection_Add(e, 0, string_null, 1, 1);
}
- other.velocity = trigger_push_calculatevelocity(other.origin, RandomSelection_chosen_ent, self.height);
+ other.velocity = trigger_push_calculatevelocity(other.origin, RandomSelection_chosen_ent, this.height);
other.move_velocity = other.velocity;
}
else
{
- other.velocity = self.movedir;
+ other.velocity = this.movedir;
other.move_velocity = other.velocity;
}
// reset tracking of oldvelocity for impact damage (sudden velocity changes)
other.oldvelocity = other.velocity;
- if(self.pushltime < time) // prevent "snorring" sound when a player hits the jumppad more than once
+ if(this.pushltime < time) // prevent "snorring" sound when a player hits the jumppad more than once
{
// flash when activated
Send_Effect(EFFECT_JUMPPAD, other.origin, other.velocity, 1);
- _sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
- self.pushltime = time + 0.2;
+ _sound (other, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM);
+ this.pushltime = time + 0.2;
}
if(IS_REAL_CLIENT(other) || IS_BOT_CLIENT(other))
{
bool found = false;
for(int i = 0; i < other.jumppadcount && i < NUM_JUMPPADSUSED; ++i)
- if(other.(jumppadsused[i]) == self)
+ if(other.(jumppadsused[i]) == this)
found = true;
if(!found)
{
- other.(jumppadsused[other.jumppadcount % NUM_JUMPPADSUSED]) = self;
+ other.(jumppadsused[other.jumppadcount % NUM_JUMPPADSUSED]) = this;
other.jumppadcount = other.jumppadcount + 1;
}
if(IS_REAL_CLIENT(other))
{
- if(self.message)
- centerprint(other, self.message);
+ if(this.message)
+ centerprint(other, this.message);
}
else
other.lastteleporttime = time;
other.istypefrag = 0;
}
- if(self.enemy.target)
+ if(this.enemy.target)
{
activator = other;
- WITH(entity, self, self.enemy, SUB_UseTargets());
+ WITH(entity, self, this.enemy, SUB_UseTargets());
}
if (other.flags & FL_PROJECTILE)
UpdateCSQCProjectile(other);
}
- if (self.spawnflags & PUSH_ONCE)
+ if (this.spawnflags & PUSH_ONCE)
{
- self.touch = func_null;
- self.think = SUB_Remove;
- self.nextthink = time;
+ this.touch = func_null;
+ this.think = SUB_Remove_self;
+ this.nextthink = time;
}
#endif
}
SUB_UseTargets();
}
-void monoflop_reset()
-{SELFPARAM();
- self.state = 0;
- self.nextthink = 0;
+void monoflop_reset(entity this)
+{
+ this.state = 0;
+ this.nextthink = 0;
}
spawnfunc(trigger_monoflop)
}
}
-void multi_reset()
-{SELFPARAM();
- if ( !(self.spawnflags & SPAWNFLAG_NOTOUCH) )
- self.touch = multi_touch;
- if (self.max_health)
+void multi_reset(entity this)
+{
+ if ( !(this.spawnflags & SPAWNFLAG_NOTOUCH) )
+ this.touch = multi_touch;
+ if (this.max_health)
{
- self.health = self.max_health;
- self.takedamage = DAMAGE_YES;
- self.solid = SOLID_BBOX;
+ this.health = this.max_health;
+ this.takedamage = DAMAGE_YES;
+ this.solid = SOLID_BBOX;
}
- self.think = func_null;
- self.nextthink = 0;
- self.team = self.team_saved;
+ this.think = func_null;
+ this.nextthink = 0;
+ this.team = this.team_saved;
}
/*QUAKED spawnfunc_trigger_multiple (.5 .5 .5) ? notouch
#ifdef SVQC
void multi_trigger();
-void multi_reset();
+void multi_reset(entity this);
spawnfunc(trigger_once);
#endif
#ifdef SVQC
-void _spawnfunc_trigger_relay();
/*QUAKED spawnfunc_trigger_relay (.5 .5 .5) (-8 -8 -8) (8 8 8)
This fixed size trigger cannot be touched, it can only be fired by other events. It can contain killtargets, targets, delays, and messages.
*/
spawnfunc(trigger_relay)
{
- self.use = SUB_UseTargets;
- self.reset = _spawnfunc_trigger_relay; // this spawnfunc resets fully
+ this.use = SUB_UseTargets;
+ this.reset = spawnfunc_trigger_relay; // this spawnfunc resets fully
}
-void _spawnfunc_trigger_relay() { SELFPARAM(); spawnfunc_trigger_relay(this); }
#endif
}
}
-void trigger_relay_teamcheck_reset()
-{SELFPARAM();
- self.team = self.team_saved;
+void trigger_relay_teamcheck_reset(entity this)
+{
+ this.team = this.team_saved;
}
spawnfunc(trigger_relay_teamcheck)
{
- self.team_saved = self.team;
- self.use = trigger_relay_teamcheck_use;
- self.reset = trigger_relay_teamcheck_reset;
+ this.team_saved = this.team;
+ this.use = trigger_relay_teamcheck_use;
+ this.reset = trigger_relay_teamcheck_reset;
}
#endif
}
#ifdef TURRET_DEBUG
-void SUB_Remove();
void marker_think()
{SELFPARAM();
if(self.cnt)
proj.use = vehicles_projectile_explode;
proj.owner = self;
proj.realowner = _owner;
- proj.think = SUB_Remove;
+ proj.think = SUB_Remove_self;
proj.nextthink = time + 30;
if(_health)
if(ret.wp00 == veh)
{
ret.classname = "";
- ret.think = SUB_Remove;
+ ret.think = SUB_Remove_self;
ret.nextthink = time + 0.1;
if(ret.waypointsprite_attached)
void W_Blaster_Think()
{SELFPARAM();
- self.movetype = MOVETYPE_FLY;
- self.think = SUB_Remove;
- self.nextthink = time + self.blaster_lifetime;
- CSQCProjectile(self, true, PROJECTILE_BLASTER, true);
+ this.movetype = MOVETYPE_FLY;
+ this.think = SUB_Remove_self;
+ this.nextthink = time + this.blaster_lifetime;
+ CSQCProjectile(this, true, PROJECTILE_BLASTER, true);
}
void W_Blaster_Attack(
W_Crylink_Dequeue_Raw(e.realowner, e.queueprev, e, e.queuenext);
}
-void W_Crylink_Reset()
-{SELFPARAM();
- W_Crylink_Dequeue(self);
- remove(self);
+void W_Crylink_Reset(entity this)
+{
+ W_Crylink_Dequeue(this);
+ remove(this);
}
// force projectile to explode
//missile.angles = vectoangles(missile.velocity); // csqc
missile.touch = W_HLAC_Touch;
- missile.think = SUB_Remove;
+ missile.think = SUB_Remove_self;
missile.nextthink = time + WEP_CVAR_PRI(hlac, lifetime);
//missile.angles = vectoangles(missile.velocity); // csqc
missile.touch = W_HLAC_Touch;
- missile.think = SUB_Remove;
+ missile.think = SUB_Remove_self;
missile.nextthink = time + WEP_CVAR_SEC(hlac, lifetime);
void W_MachineGun_MuzzleFlash_Think()
{SELFPARAM();
- self.frame = self.frame + 2;
- self.scale = self.scale * 0.5;
- self.alpha = self.alpha - 0.25;
- self.nextthink = time + 0.05;
+ this.frame += 2;
+ this.scale *= 0.5;
+ this.alpha -= 0.25;
+ this.nextthink = time + 0.05;
- if(self.alpha <= 0)
+ if(this.alpha <= 0)
{
- self.think = SUB_Remove;
- self.nextthink = time;
- self.realowner.muzzle_flash = world;
+ this.think = SUB_Remove_self;
+ this.nextthink = time;
+ this.realowner.muzzle_flash = world;
return;
}
missile.bot_dodge = true;
missile.bot_dodgerating = 50;
missile.touch = W_Seeker_Tag_Touch;
- missile.think = SUB_Remove;
+ missile.think = SUB_Remove_self;
missile.nextthink = time + WEP_CVAR(seeker, tag_lifetime);
missile.movetype = MOVETYPE_FLY;
missile.solid = SOLID_BBOX;
// muzzle flash for 1st person view
flash = spawn();
setmodel(flash, MDL_SHOTGUN_MUZZLEFLASH); // precision set below
- flash.think = SUB_Remove;
+ flash.think = SUB_Remove_self;
flash.nextthink = time + 0.06;
flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
W_AttachToShotorg(self, flash, '5 0 0');
NET_HANDLE(TE_CSQC_VAPORBEAMPARTICLE, bool isNew)
{
Net_Accept(vortex_beam);
- this.think = SUB_Remove;
+ this.think = SUB_Remove_self;
this.nextthink = time + bound(0, autocvar_cl_vaporizerbeam_lifetime, 10);
this.draw = VaporizerBeam_Draw;
this.drawmask = MASK_NORMAL;
#pragma noref 0
-#define ReadFloat() ReadCoord()
-
#endif
#pragma noref 0
-#define WriteFloat(to, f) WriteCoord(to, f)
-
#endif
class(Defer).void() think;
class(Defer).float nextthink;
-/*
-==================
-SUB_Remove
+ /** Remove self */
+ void SUB_Remove(entity this)
+ {
+ remove(this);
+ }
-Remove self
-==================
-*/
- void SUB_Remove()
+ /** Remove self */
+ void SUB_Remove_self()
{
SELFPARAM();
- remove(self);
+ remove(this);
}
void defer_think()
{
SELFPARAM();
- self.think = SUB_Remove;
+ self.think = SUB_Remove_self;
self.nextthink = time;
WITH(entity, self, self.owner, self.use());
}
#define MAP_H
// Databases (hash tables)
-const float DB_BUCKETS = 8192;
-void db_save(float db, string pFilename)
+const int DB_BUCKETS = 8192;
+void db_save(int db, string filename)
{
- int fh = fopen(pFilename, FILE_WRITE);
+ int fh = fopen(filename, FILE_WRITE);
if (fh < 0)
{
- LOG_INFO(strcat("^1Can't write DB to ", pFilename));
+ LOG_WARNINGF("^1Can't write DB to %s\n", filename);
return;
}
- int n = buf_getsize(db);
fputs(fh, strcat(ftos(DB_BUCKETS), "\n"));
- for (int i = 0; i < n; ++i)
+ for (int i = 0, n = buf_getsize(db); i < n; ++i)
fputs(fh, strcat(bufstr_get(db, i), "\n"));
fclose(fh);
}
return buf_create();
}
-void db_put(float db, string pKey, string pValue);
+void db_put(int db, string key, string value);
-int db_load(string pFilename)
+int db_load(string filename)
{
int db = buf_create();
if (db < 0) return -1;
- int fh = fopen(pFilename, FILE_READ);
+ int fh = fopen(filename, FILE_READ);
if (fh < 0) return db;
string l = fgets(fh);
- if (stof(l) == DB_BUCKETS)
+ if (stoi(l) == DB_BUCKETS)
{
for (int i = 0; (l = fgets(fh)); ++i)
{
return db;
}
-void db_dump(float db, string pFilename)
+void db_dump(int db, string filename)
{
- int fh = fopen(pFilename, FILE_WRITE);
- if (fh < 0) error(strcat("Can't dump DB to ", pFilename));
- int n = buf_getsize(db);
+ int fh = fopen(filename, FILE_WRITE);
+ if (fh < 0) LOG_FATALF("Can't dump DB to %s\n");
fputs(fh, "0\n");
- for (int i = 0; i < n; ++i)
+ for (int i = 0, n = buf_getsize(db); i < n; ++i)
{
int m = tokenizebyseparator(bufstr_get(db, i), "\\");
for (int j = 2; j < m; j += 2)
fclose(fh);
}
-void db_close(float db)
+void db_close(int db)
{
buf_del(db);
}
-string db_get(float db, string pKey)
+string db_get(int db, string key)
{
- int h = crc16(false, pKey) % DB_BUCKETS;
- return uri_unescape(infoget(bufstr_get(db, h), pKey));
+ int h = crc16(false, key) % DB_BUCKETS;
+ return uri_unescape(infoget(bufstr_get(db, h), key));
}
-void db_put(float db, string pKey, string pValue)
+#define db_remove(db, key) db_put(db, key, "")
+
+void db_put(int db, string key, string value)
{
- int h = crc16(false, pKey) % DB_BUCKETS;
- bufstr_set(db, h, infoadd(bufstr_get(db, h), pKey, uri_escape(pValue)));
+ int h = crc16(false, key) % DB_BUCKETS;
+ bufstr_set(db, h, infoadd(bufstr_get(db, h), key, uri_escape(value)));
}
void db_test()
if (dt)
{
e.nextthink = time + dt;
- e.think = SUB_Remove;
+ e.think = SUB_Remove_self;
}
}
REGISTRY(LinkedEntities, BITS(8) - 1)
#define LinkedEntities_from(i) _LinkedEntities_from(i, NULL)
REGISTER_REGISTRY(LinkedEntities)
-REGISTRY_SORT(LinkedEntities, 0)
+REGISTRY_SORT(LinkedEntities)
REGISTRY_CHECK(LinkedEntities)
STATIC_INIT(RegisterLinkedEntities_renumber)
{
REGISTRY(TempEntities, BITS(8) - 80)
#define TempEntities_from(i) _TempEntities_from(i, NULL)
REGISTER_REGISTRY(TempEntities)
-REGISTRY_SORT(TempEntities, 0)
+REGISTRY_SORT(TempEntities)
REGISTRY_CHECK(TempEntities)
STATIC_INIT(RegisterTempEntities_renumber)
{
return v;
}
+ #define ReadFloat() ReadCoord()
+ vector ReadVector() { vector v; v.x = ReadFloat(); v_y = ReadFloat(); v.z = ReadFloat(); return v; }
+ vector ReadVector2D() { vector v; v.x = ReadFloat(); v.y = ReadFloat(); v.z = 0; return v; }
+
float ReadApproxPastTime()
{
float dt = ReadByte();
WriteInt24_t(dst, val.z);
}
+ #define WriteFloat(to, f) WriteCoord(to, f)
+ #define WriteVector(to, v) do { WriteFloat(to, v.x); WriteFloat(to, v.y); WriteFloat(to, v.z); } while (0)
+ #define WriteVector2D(to, v) do { WriteFloat(to, v.x); WriteFloat(to, v.y); } while (0)
+
// this will use the value:
// 128
// accuracy near zero is APPROXPASTTIME_MAX/(256*255)
* @param fld The field to store the locally unique unique entity id
* @param inst An expression to create a new instance, invoked for every registration
*/
-#define REGISTER(registry, ns, id, fld, inst) \
- entity ns##_##id; \
- REGISTER_INIT(ns, id) {} \
- REGISTER_INIT_POST(ns, id) {} \
- void Register_##ns##_##id() \
+#define REGISTER(...) EVAL(OVERLOAD(REGISTER, __VA_ARGS__))
+#define REGISTER_5(registry, ns, id, fld, inst) REGISTER_4(registry, ns##_##id, fld, inst)
+#define REGISTER_4(registry, id, fld, inst) \
+ entity id; \
+ REGISTER_INIT(id) {} \
+ REGISTER_INIT_POST(id) {} \
+ void Register_##id() \
{ \
if (registry##_COUNT >= registry##_MAX) LOG_FATALF("Registry capacity exceeded (%s)", ftos(registry##_MAX)); \
- entity this = ns##_##id = inst; \
+ entity this = id = inst; \
this.registered_id = #id; \
this.fld = registry##_COUNT; \
_##registry[registry##_COUNT] = this; \
if (!registry##_first) registry##_first = this; \
if (registry##_last) registry##_last.REGISTRY_NEXT = this; \
registry##_last = this; \
- Register_##ns##_##id##_init(this); \
- Register_##ns##_##id##_init_post(this); \
+ Register_##id##_init(this); \
+ Register_##id##_init_post(this); \
} \
- ACCUMULATE_FUNCTION(Register##registry, Register_##ns##_##id) \
- REGISTER_INIT(ns, id)
+ ACCUMULATE_FUNCTION(Register##registry, Register_##id) \
+ REGISTER_INIT(id)
-#define REGISTER_INIT(ns, id) [[accumulate]] void Register_##ns##_##id##_init(entity this)
-#define REGISTER_INIT_POST(ns, id) [[accumulate]] void Register_##ns##_##id##_init_post(entity this)
+#define REGISTER_INIT(id) [[accumulate]] void Register_##id##_init(entity this)
+#define REGISTER_INIT_POST(id) [[accumulate]] void Register_##id##_init_post(entity this)
/** internal next pointer */
#define REGISTRY_NEXT enemy
.entity REGISTRY_NEXT;
-#define REGISTRY_SORT(id, skip) \
+#define REGISTRY_SORT(...) EVAL(OVERLOAD(REGISTRY_SORT, __VA_ARGS__))
+#define REGISTRY_SORT_1(id) REGISTRY_SORT_2(id, 0)
+#define REGISTRY_SORT_2(id, skip) \
void _REGISTRY_SWAP_##id(int i, int j, entity pass) \
{ \
i += skip; j += skip; \
#define _spawnfunc_check(fld) \
if (fieldname == #fld) continue;
- #define spawnfunc_1(id, whitelist) spawnfunc_2(id, whitelist)
+ bool __spawnfunc_unreachable_workaround = true;
+
+ #define spawnfunc_1(id) spawnfunc_2(id, FIELDS_UNION)
#define spawnfunc_2(id, whitelist) \
- void spawnfunc_##id(entity this) \
+ void __spawnfunc_##id(entity this); \
+ [[accumulate]] void spawnfunc_##id(entity this) \
{ \
this = self; \
if (!this.sourceLocFile) \
} \
this.spawnfunc_checked = true; \
} \
+ __spawnfunc_##id(this); \
+ if (__spawnfunc_unreachable_workaround) return; \
} \
- [[accumulate]] void spawnfunc_##id(entity this)
+ void __spawnfunc_##id(entity this)
#define FIELD_SCALAR(fld, n) \
fld(n)
FIELD_VEC(fld, velocity) \
/**/
- #define spawnfunc(...) EVAL(OVERLOAD(spawnfunc, __VA_ARGS__, FIELDS_UNION))
+ #define spawnfunc(...) EVAL(OVERLOAD(spawnfunc, __VA_ARGS__))
#endif
REGISTRY(Stats, 220 - STATS_ENGINE_RESERVE)
REGISTER_REGISTRY(Stats)
-REGISTRY_SORT(Stats, 0)
+REGISTRY_SORT(Stats)
REGISTRY_CHECK(Stats)
STATIC_INIT(RegisterStats_renumber)
{
ts.SendEntity = WarpZone_Teleported_Send;
ts.SendFlags = 0xFFFFFF;
ts.drawonlytoclient = player;
- ts.think = SUB_Remove;
+ ts.think = SUB_Remove_self;
ts.nextthink = time + 1;
ts.owner = player;
ts.enemy = wz;
save = draw_alpha;
if (me.disabled) draw_alpha *= me.disabledAlpha;
draw_ButtonPicture('0 0 0', strcat(me.src, "_s"), eX * (1 - me.textSpace) + eY, me.color2, 1);
+ if (me.valueMax > me.valueMin) // valid?
if (almost_in_bounds(me.valueMin, me.sliderValue, me.valueMax))
{
controlLeft = (me.sliderValue - me.valueMin) / (me.valueMax - me.valueMin) * (1 - me.textSpace - me.controlWidth);
me.sliderAnim = NULL;
}
- me.setText(me, me.valueToText(me, me.value));
+ if (me.valueMax > me.valueMin) // valid?
+ me.setText(me, me.valueToText(me, me.value));
draw_alpha = save;
SUPER(Slider).draw(me);
me.text = string_null; // TEMPSTRING!
#ifdef IMPLEMENTATION
-void GameType_ConfigureSliders(entity e, entity l, string pLabel, float pMin, float pMax, float pStep, string pCvar, string theTooltip)
+void GameType_ConfigureSliders(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip)
{
- if(pCvar == "")
+ int i;
+ entity e = me.sliderFraglimit;
+ entity l = me.labelFraglimit;
+ e.configureXonoticTextSlider(e, pCvar, pTooltip);
+ e.disabled = l.disabled = !pCvar;
+ l.setText(l, pLabel);
+
+ // clear old values
+ for(i = 0; i < e.nValues; ++i);
{
- e.configureXonoticTextSlider(e, string_null, string_null);
- l.setText(l, pLabel);
- e.disabled = l.disabled = true;
- }
- else
- {
- e.configureXonoticTextSlider(e, pCvar, theTooltip);
-
- // clear old values
- int i;
- for(i = 0; i <= e.nValues; ++i);
+ if(e.(valueStrings[i]))
+ {
+ strunzone(e.(valueStrings[i]));
+ e.(valueStrings[i]) = string_null;
+ }
+ if(e.(valueIdentifiers[i]))
{
- if(e.(valueStrings[i])) { strunzone(e.(valueStrings[i])); }
- if(e.(valueIdentifiers[i])) { strunzone(e.(valueIdentifiers[i])); }
+ strunzone(e.(valueIdentifiers[i]));
+ e.(valueIdentifiers[i]) = string_null;
}
- e.clearValues(e);
+ }
+ e.clearValues(e);
+ if(pCvar != "")
+ {
// set new values
e.addValue(e, strzone(_("Default")), strzone("-1"));
for(i = pMin; i <= pMax; i += pStep) { e.addValue(e, strzone(ftos(i)), strzone(ftos(i))); }
e.addValue(e, strzone(_("Unlimited")), strzone("0"));
- e.configureXonoticTextSliderValues(e);
-
- // set text field
- l.setText(l, pLabel);
- e.disabled = l.disabled = false;
}
+ e.configureXonoticTextSliderValues(e);
+
+
+ entity t = me.sliderTeams;
+ entity tl = me.labelTeams;
+ t.configureXonoticTextSlider(t, tCvar, string_null);
+ tl.disabled = t.disabled = !tCvar;
+ t.nValues = (tCvar == "") ? 0 : 4; // instead of clearing / readding the very same values
+ t.configureXonoticTextSliderValues(t);
}
entity makeXonoticServerCreateTab()
void XonoticServerCreateTab_gameTypeChangeNotify(entity me)
{
- // tell the map list to update
- float gt;
- entity e, l;
- gt = MapInfo_CurrentGametype();
- e = me.sliderFraglimit;
- l = me.labelFraglimit;
-
- switch(gt)
+ switch(MapInfo_CurrentGametype())
{
- case MAPINFO_TYPE_CTF: GameType_ConfigureSliders(e, l, _("Capture limit:"), 1, 20, 1, "capturelimit_override", string_null); break;
- case MAPINFO_TYPE_DOMINATION: GameType_ConfigureSliders(e, l, _("Point limit:"), 50, 500, 10, "g_domination_point_limit", string_null); break;
- case MAPINFO_TYPE_KEYHUNT: GameType_ConfigureSliders(e, l, _("Point limit:"), 200, 1500, 50, "g_keyhunt_point_limit", string_null); break;
- case MAPINFO_TYPE_LMS: GameType_ConfigureSliders(e, l, _("Lives:"), 3, 50, 1, "g_lms_lives_override", string_null); break;
- case MAPINFO_TYPE_RACE: GameType_ConfigureSliders(e, l, _("Laps:"), 1, 25, 1, "g_race_laps_limit", string_null); break;
- case MAPINFO_TYPE_NEXBALL: GameType_ConfigureSliders(e, l, _("Goals:"), 1, 50, 1, "g_nexball_goallimit", string_null); break;
- case MAPINFO_TYPE_ASSAULT: GameType_ConfigureSliders(e, l, _("Point limit:"), 50, 500, 10, "", string_null); break;
- case MAPINFO_TYPE_ONSLAUGHT: GameType_ConfigureSliders(e, l, _("Point limit:"), 50, 500, 10, "", string_null); break;
- case MAPINFO_TYPE_CTS: GameType_ConfigureSliders(e, l, _("Point limit:"), 50, 500, 10, "", string_null); break;
- case MAPINFO_TYPE_INVASION: GameType_ConfigureSliders(e, l, _("Point limit:"), 5, 0, 5, "", string_null); break;
- case MAPINFO_TYPE_TEAM_DEATHMATCH:GameType_ConfigureSliders(e, l, _("Point limit:"), 5, 100, 5, "g_tdm_point_limit", string_null); break;
- default: GameType_ConfigureSliders(e, l, _("Frag limit:"), 5, 100, 5, "fraglimit_override", _("The amount of frags needed before the match will end")); break;
+ case MAPINFO_TYPE_CA: GameType_ConfigureSliders(me, _("Frag limit:"), 5, 100, 5, "fraglimit_override", "g_ca_teams_override", _("The amount of frags needed before the match will end")); break;
+ case MAPINFO_TYPE_FREEZETAG: GameType_ConfigureSliders(me, _("Frag limit:"), 5, 100, 5, "fraglimit_override", "g_freezetag_teams_override", _("The amount of frags needed before the match will end")); break;
+ case MAPINFO_TYPE_CTF: GameType_ConfigureSliders(me, _("Capture limit:"), 1, 20, 1, "capturelimit_override", string_null, _("The amount of captures needed before the match will end")); break;
+ case MAPINFO_TYPE_DOMINATION: GameType_ConfigureSliders(me, _("Point limit:"), 50, 500, 10, "g_domination_point_limit", "g_domination_teams_override", _("The amount of points needed before the match will end")); break;
+ case MAPINFO_TYPE_KEYHUNT: GameType_ConfigureSliders(me, _("Point limit:"), 200, 1500, 50, "g_keyhunt_point_limit", "g_keyhunt_teams_override", _("The amount of points needed before the match will end")); break;
+ case MAPINFO_TYPE_LMS: GameType_ConfigureSliders(me, _("Lives:"), 3, 50, 1, "g_lms_lives_override", string_null, string_null); break;
+ case MAPINFO_TYPE_RACE: GameType_ConfigureSliders(me, _("Laps:"), 1, 25, 1, "g_race_laps_limit", string_null, string_null); break;
+ case MAPINFO_TYPE_NEXBALL: GameType_ConfigureSliders(me, _("Goals:"), 1, 50, 1, "g_nexball_goallimit", string_null, _("The amount of goals needed before the match will end")); break;
+ case MAPINFO_TYPE_ASSAULT: GameType_ConfigureSliders(me, _("Point limit:"), 50, 500, 10, string_null, string_null, string_null); break;
+ case MAPINFO_TYPE_ONSLAUGHT: GameType_ConfigureSliders(me, _("Point limit:"), 50, 500, 10, string_null, string_null, string_null); break;
+ case MAPINFO_TYPE_CTS: GameType_ConfigureSliders(me, _("Point limit:"), 50, 500, 10, string_null, string_null, string_null); break;
+ case MAPINFO_TYPE_INVASION: GameType_ConfigureSliders(me, _("Point limit:"), 50, 500, 10, string_null, string_null, string_null); break;
+ case MAPINFO_TYPE_TEAM_DEATHMATCH: GameType_ConfigureSliders(me, _("Point limit:"), 5, 100, 5, "g_tdm_point_limit", "g_tdm_teams_override", _("The amount of points needed before the match will end")); break;
+ default: GameType_ConfigureSliders(me, _("Frag limit:"), 5, 100, 5, "fraglimit_override", string_null, _("The amount of frags needed before the match will end")); break;
}
- string x = string_null;
- string theTooltip = string_null;
- e = me.sliderTeams;
- switch(gt)
- {
- // old tooltip: _("Override the default amount of teams in teamgames")
- case MAPINFO_TYPE_CA: x = "g_ca_teams_override"; break;
- case MAPINFO_TYPE_DOMINATION: x = "g_domination_teams_override"; break;
- case MAPINFO_TYPE_FREEZETAG: x = "g_freezetag_teams_override"; break;
- case MAPINFO_TYPE_KEYHUNT: x = "g_keyhunt_teams_override"; break;
- case MAPINFO_TYPE_TEAM_DEATHMATCH: x = "g_tdm_teams_override"; break;
- }
- e.configureXonoticTextSlider(e, x, theTooltip);
- e.configureXonoticTextSliderValues(e);
- me.sliderTeams.disabled = me.labelTeams.disabled = !x;
-
me.mapListBox.refilter(me.mapListBox);
}
me.currentServerNumFreeSlots = strzone(s);
me.numFreeSlotsLabel.setText(me.numFreeSlotsLabel, me.currentServerNumFreeSlots);
- me.currentServerMod = ((modname == "Xonotic") ? _("Default") : modname);
+ me.currentServerMod = ((modname == "Xonotic") ? ZCTX(_("MOD^Default")) : modname);
me.currentServerMod = strzone(me.currentServerMod);
me.modLabel.setText(me.modLabel, me.currentServerMod);
METHOD(XonoticServerList, toggleFavorite, void(entity, string));
ATTRIB(XonoticServerList, iconsSizeFactor, float, 0.85)
+ METHOD(XonoticServerList, mouseMove, float(entity, vector));
+ ATTRIB(XonoticServerList, mouseOverIcons, bool, false)
+ METHOD(XonoticServerList, focusedItemChangeNotify, void(entity));
ATTRIB(XonoticServerList, realFontSize, vector, '0 0 0')
ATTRIB(XonoticServerList, realUpperMargin, float, 0)
#ifdef COMPAT_NO_MOD_IS_XONOTIC
if(modname == "")
- modname = "xonotic";
+ modname = "Xonotic";
#endif
+ string original_modname = modname;
modname = strtolower(modname);
/*
if(modname != "cts")
if(modname != "nix")
if(modname != "newtoys")
- pure = false;
+ pure_available = false;
if(gethostcachenumber(SLIST_FIELD_FREESLOTS, i) <= 0)
theAlpha = SKINALPHA_SERVERLIST_FULL;
if(sflags >= 0 && (sflags & SERVERFLAG_PLAYERSTATS))
draw_Picture(iconPos, "icon_stats1", iconSize, '1 1 1', 1);
+ if(isFocused && me.mouseOverIcons && !me.tooltip)
+ {
+ string t = "";
+ if(me.seenIPv4 && me.seenIPv6)
+ t = strcat(t, (isv6) ? "IPv6, " : "IPv4, ");
+ t = strcat(t, _("encryption:"), " ", (q ? sprintf(_("AES level %d"), q) : ZCTX(_("ENC^none"))), ", ");
+ t = strcat(t, sprintf(_("mod: %s"), ((modname == "xonotic") ? ZCTX(_("MOD^Default")) : original_modname)));
+ if(pure_available)
+ t = strcat(t, sprintf(_(" (%s)"), (pure) ? _("official settings") : _("modified settings")));
+ t = strcat(t, ", ");
+ t = strcat(t, ((sflags >= 0 && (sflags & SERVERFLAG_PLAYERSTATS)) ? _("stats enabled") : _("stats disabled")));
+ setZonedTooltip(me, t, string_null);
+ }
// --------------
// RENDER TEXT
// --------------
draw_Text(me.realUpperMargin * eY + (me.columnPlayersOrigin + (me.columnPlayersSize - draw_TextWidth(s, 0, me.realFontSize)) * 0.5) * eX, s, me.realFontSize, theColor, theAlpha, 0);
}
+void XonoticServerList_focusedItemChangeNotify(entity me)
+{
+ clearTooltip(me);
+}
+
+float XonoticServerList_mouseMove(entity me, vector pos)
+{
+ if(!SUPER(XonoticServerList).mouseMove(me, pos))
+ {
+ me.mouseOverIcons = false;
+ clearTooltip(me);
+ return 1;
+ }
+
+ me.mouseOverIcons = (pos_x <= me.columnIconsSize);
+ if(!me.mouseOverIcons)
+ clearTooltip(me);
+ return 1;
+}
+
bool XonoticServerList_keyDown(entity me, int scan, bool ascii, bool shift)
{
vector org, sz;
void saveCvarsMulti(entity me)
{
float n, i;
- string s;
+ string s, cvarname;
me.saveCvars_Multi(me);
s = cvar_string(me.cvarName);
n = tokenize_console(me.cvarNames_Multi);
for(i = 0; i < n; ++i)
{
+ // cvars prefixed with ! get saved with the inverted value
if(substring(argv(i), 0, 1) == "!")
- cvar_set(substring(argv(i), 1, strlen(argv(i))), ((s == "0") ? "1" : "0"));
+ {
+ cvarname = substring(argv(i), 1, strlen(argv(i)));
+ cvar_set(cvarname, ((s == "0") ? "1" : "0"));
+ }
else
- cvar_set(argv(i), s);
+ {
+ cvarname = argv(i);
+ cvar_set(cvarname, s);
+ }
- CheckSendCvars(me, argv(i));
+ CheckSendCvars(me, cvarname);
}
}
void makeMulti(entity e, string otherCvars)
// =======================
// Resets the state of all clients, items, weapons, waypoints, ... of the map.
-void reset_map(float dorespawn)
+void reset_map(bool dorespawn)
{
SELFPARAM();
- if (time <= game_starttime && round_handler_IsActive())
- round_handler_Reset(game_starttime);
+ if (time <= game_starttime && round_handler_IsActive()) round_handler_Reset(game_starttime);
MUTATOR_CALLHOOK(reset_map_global);
for (entity e = world; (e = nextent(e)); )
{
- setself(e);
- if (IS_NOT_A_CLIENT(self))
+ if (IS_NOT_A_CLIENT(e))
{
- if (self.reset)
+ if (e.reset)
{
- self.reset();
+ WITH(entity, self, e, e.reset(e));
continue;
}
-
- if (self.team_saved) self.team = self.team_saved;
-
- if (self.flags & FL_PROJECTILE) // remove any projectiles left
- remove(self);
+ if (e.team_saved) e.team = e.team_saved;
+ if (e.flags & FL_PROJECTILE) remove(e); // remove any projectiles left
}
}
entity e;
FOR_EACH_PLAYER(e)
- if (e.frozen) WITH(entity, self, e, Unfreeze(self));
+ if (e.frozen) WITH(entity, self, e, Unfreeze(e));
// Moving the player reset code here since the player-reset depends
// on spawnpoint entities which have to be reset first --blub
void ReadyRestart_think()
{
SELFPARAM();
- restart_mapalreadyrestarted = 1;
+ restart_mapalreadyrestarted = true;
reset_map(true);
Score_ClearAll();
- remove(self);
+ remove(this);
}
// Forces a restart of the game without actually reloading the map // this is a mess...
void ReadyRestart_force()
{
- entity tmp_player, restart_timer;
-
bprint("^1Server is restarting...\n");
VoteReset();
// clear overtime, we have to decrease timelimit to its original value again.
- if (checkrules_overtimesadded > 0 && g_race_qualifying != 2) cvar_set("timelimit", ftos(autocvar_timelimit - (checkrules_overtimesadded * autocvar_timelimit_overtime)));
+ if (checkrules_overtimesadded > 0 && g_race_qualifying != 2)
+ cvar_set("timelimit", ftos(autocvar_timelimit - (checkrules_overtimesadded * autocvar_timelimit_overtime)));
checkrules_suddendeathend = checkrules_overtimesadded = checkrules_suddendeathwarning = 0;
- readyrestart_happened = 1;
+ readyrestart_happened = true;
game_starttime = time + RESTART_COUNTDOWN;
+ entity tmp_player;
+
// clear player attributes
FOR_EACH_CLIENT(tmp_player)
{
PS_GR_P_ADDVAL(tmp_player, PLAYERSTATS_ALIVETIME, -PS_GR_P_ADDVAL(tmp_player, PLAYERSTATS_ALIVETIME, 0));
}
- restart_mapalreadyrestarted = 0; // reset this var, needed when cvar sv_ready_restart_repeatable is in use
+ restart_mapalreadyrestarted = false; // reset this var, needed when cvar sv_ready_restart_repeatable is in use
// disable the warmup global for the server
warmup_stage = 0; // once the game is restarted the game is in match stage
// reset the .ready status of all players (also spectators)
FOR_EACH_REALCLIENT(tmp_player)
{
- tmp_player.ready = 0;
+ tmp_player.ready = false;
}
readycount = 0;
Nagger_ReadyCounted(); // NOTE: this causes a resend of that entity, and will also turn off warmup state on the client
// lock teams with lockonrestart
if (autocvar_teamplay_lockonrestart && teamplay)
{
- lockteams = 1;
+ lockteams = true;
bprint("^1The teams are now locked.\n");
}
// initiate the restart-countdown-announcer entity
if (autocvar_sv_ready_restart_after_countdown)
{
- restart_timer = spawn();
+ entity restart_timer = new(restart_timer);
+ make_pure(restart_timer);
restart_timer.think = ReadyRestart_think;
restart_timer.nextthink = game_starttime;
}
{
tmp_player.allowed_timeouts = autocvar_sv_timeout_number;
}
- // reset map immediately if this cvar is not set
- if (!autocvar_sv_ready_restart_after_countdown) reset_map(true); }
- if (autocvar_sv_eventlog) GameLogEcho(":restart"); }
+ }
+ // reset map immediately if this cvar is not set
+ if (!autocvar_sv_ready_restart_after_countdown) reset_map(true);
+ if (autocvar_sv_eventlog) GameLogEcho(":restart");
+}
void ReadyRestart()
{
// Reset ALL scores, but only do that at the beginning of the countdown if sv_ready_restart_after_countdown is off!
// Otherwise scores could be manipulated during the countdown.
- if (!autocvar_sv_ready_restart_after_countdown) Score_ClearAll();
+ if (!autocvar_sv_ready_restart_after_countdown) Score_ClearAll();
ReadyRestart_force();
}
void SUB_DontUseTargets();
void SUB_UseTargets();
-.void() reset; // if set, an entity is reset using this
+.void(entity this) reset; // if set, an entity is reset using this
.void() reset2; // if set, an entity is reset using this (after calling ALL the reset functions for other entities)
void ClientData_Touch(entity e);
farcent.origin = hitloc;
farcent.forcetype = FORCETYPE_FORCEATPOS;
farcent.nextthink = time + 0.1;
- farcent.think = SUB_Remove;
+ farcent.think = SUB_Remove_self;
}
else
{
//pl.disableclientprediction = false;
}
-void GrapplingHookReset()
-{SELFPARAM();
- if(self.realowner.hook == self)
- RemoveGrapplingHook(self.owner);
+void GrapplingHookReset(entity this)
+{
+ if(this.realowner.hook == this)
+ RemoveGrapplingHook(this.owner);
else // in any case:
- remove(self);
+ remove(this);
}
void GrapplingHookThink();
void() SUB_CalcMoveDone;
void() SUB_CalcAngleMoveDone;
//void() SUB_UseTargets;
-void() SUB_Remove;
spawnfunc(info_null);
void updateanim(entity e);
-/*
-==================
-SUB_Remove
-Remove self
-==================
-*/
-void SUB_Remove ();
/*
==================
if(s != "")
{
db_put(ServerProgsDB, strcat("/uid2name/", myuid), s);
- db_put(ServerProgsDB, strcat("uid2name", myuid), "");
+ db_remove(ServerProgsDB, strcat("uid2name", myuid));
}
}
void objerror(string s);
void droptofloor();
-void() SUB_Remove;
void attach_sameorigin(entity e, entity to, string tag);
// reset this objective. Used when spawning an objective
// and when a new round starts
-void assault_objective_reset()
-{SELFPARAM();
- self.health = ASSAULT_VALUE_INACTIVE;
+void assault_objective_reset(entity this)
+{
+ this.health = ASSAULT_VALUE_INACTIVE;
}
// decrease the health of targeted objectives
assault_setenemytoobjective();
}
-void target_assault_roundend_reset()
-{SELFPARAM();
+void target_assault_roundend_reset(entity this)
+{
//print("round end reset\n");
- self.cnt = self.cnt + 1; // up round counter
- self.winning = 0; // up round
+ ++this.cnt; // up round counter
+ this.winning = false; // up round
}
void target_assault_roundend_use()
spawnfunc(target_objective)
{
- if (!g_assault) { remove(self); return; }
+ if (!g_assault) { remove(this); return; }
- self.classname = "target_objective";
- self.use = assault_objective_use;
- assault_objective_reset();
- self.reset = assault_objective_reset;
- self.spawn_evalfunc = target_objective_spawn_evalfunc;
+ this.classname = "target_objective";
+ this.use = assault_objective_use;
+ this.reset = assault_objective_reset;
+ this.reset(this);
+ this.spawn_evalfunc = target_objective_spawn_evalfunc;
}
spawnfunc(target_objective_decrease)
bool autocvar_g_ctf_flag_glowtrails;
int autocvar_g_ctf_flag_health;
bool autocvar_g_ctf_flag_return;
+bool autocvar_g_ctf_flag_return_carrying;
float autocvar_g_ctf_flag_return_carried_radius;
float autocvar_g_ctf_flag_return_time;
bool autocvar_g_ctf_flag_return_when_unreachable;
case FLAG_DROPPED:
{
- if(CTF_SAMETEAM(toucher, flag) && (autocvar_g_ctf_flag_return || num_perteam <= 1) && flag.team) // automatically return if there's only 1 player on the team
+ if(CTF_SAMETEAM(toucher, flag) && (autocvar_g_ctf_flag_return || num_perteam <= 1 || (autocvar_g_ctf_flag_return_carrying && toucher.flagcarried)) && flag.team) // automatically return if there's only 1 player on the team
ctf_Handle_Return(flag, toucher); // toucher just returned his own flag
else if(is_not_monster && (!toucher.flagcarried) && ((toucher != flag.ctf_dropper) || (time > flag.ctf_droptime + autocvar_g_ctf_flag_collect_delay)))
ctf_Handle_Pickup(flag, toucher, PICKUP_DROPPED); // toucher just picked up a dropped enemy flag
ctf_CheckStalemate();
}
-void ctf_Reset()
-{SELFPARAM();
- if(self.owner)
- if(IS_PLAYER(self.owner))
- ctf_Handle_Throw(self.owner, world, DROP_RESET);
+void ctf_Reset(entity this)
+{
+ if(this.owner && IS_PLAYER(this.owner))
+ ctf_Handle_Throw(this.owner, world, DROP_RESET);
- ctf_RespawnFlag(self);
+ ctf_RespawnFlag(this);
}
void ctf_DelayedFlagSetup() // called after a flag is placed on a map by ctf_FlagSetup()
dompoint_captured();
}
-void dom_controlpoint_setup()
-{SELFPARAM();
+void dom_controlpoint_setup(entity this);
+void dom_controlpoint_setup_self() { SELFPARAM(); dom_controlpoint_setup(this); }
+void dom_controlpoint_setup(entity this)
+{
entity head;
// find the spawnfunc_dom_team representing unclaimed points
head = find(world, classname, "dom_team");
remove(self);
return;
}
- self.think = dom_controlpoint_setup;
+ self.think = dom_controlpoint_setup_self;
self.nextthink = time + 0.1;
self.reset = dom_controlpoint_setup;
setself(this);
}
-void _spawnfunc_dom_controlpoint() { SELFPARAM(); spawnfunc_dom_controlpoint(self); }
+void self_spawnfunc_dom_controlpoint() { SELFPARAM(); spawnfunc_dom_controlpoint(self); }
void dom_spawnpoint(vector org)
{SELFPARAM();
setself(spawn());
self.classname = "dom_controlpoint";
- self.think = _spawnfunc_dom_controlpoint;
+ self.think = self_spawnfunc_dom_controlpoint;
self.nextthink = time;
setorigin(self, org);
spawnfunc_dom_controlpoint(this);
monster = spawnmonster("", mon, world, world, e.origin, false, false, 2);
else return;
- e.think = SUB_Remove;
+ e.think = SUB_Remove_self;
e.nextthink = time + 0.1;
}
else
WaypointSprite_Kill(plyr.waypointsprite_attachedforcarrier);
}
-void ka_Reset() // used to clear the ballcarrier whenever the match switches from warmup to normal
-{SELFPARAM();
- if((self.owner) && (IS_PLAYER(self.owner)))
- ka_DropEvent(self.owner);
+/** used to clear the ballcarrier whenever the match switches from warmup to normal */
+void ka_Reset(entity this)
+{
+ if((this.owner) && (IS_PLAYER(this.owner)))
+ ka_DropEvent(this.owner);
if(time < game_starttime)
{
- self.think = ka_RespawnBall;
- self.touch = func_null;
- self.nextthink = game_starttime;
+ this.think = ka_RespawnBall;
+ this.touch = func_null;
+ this.nextthink = game_starttime;
}
else
ka_RespawnBall();
self.nextthink = time + 0.05;
}
-void key_reset()
-{SELFPARAM();
- kh_Key_AssignTo(self, world);
- kh_Key_Remove(self);
+void key_reset(entity this)
+{
+ kh_Key_AssignTo(this, world);
+ kh_Key_Remove(this);
}
const string STR_ITEM_KH_KEY = "item_kh_key";
MUTATOR_HOOKFUNCTION(lms, FilterItem)
{SELFPARAM();
if(autocvar_g_lms_extra_lives)
- if(self.itemdef == ITEM_HealthMega)
- {
- self.max_health = 1;
+ if(self.itemdef == ITEM_ExtraLife)
return false;
- }
+
+ return true;
+}
+
+void lms_extralife()
+{SELFPARAM();
+ StartItem(this, ITEM_ExtraLife);
+}
+
+MUTATOR_HOOKFUNCTION(lms, OnEntityPreSpawn)
+{SELFPARAM();
+ if (!autocvar_g_powerups) return false;
+ if (!autocvar_g_lms_extra_lives) return false;
+
+ // Can't use .itemdef here
+ if (self.classname != "item_health_mega") return false;
+
+ entity e = spawn();
+ e.think = lms_extralife;
+
+ e.nextthink = time + 0.1;
+ e.spawnflags = self.spawnflags;
+ e.noalign = self.noalign;
+ setorigin(e, self.origin);
return true;
}
MUTATOR_HOOKFUNCTION(lms, ItemTouch)
{SELFPARAM();
- // give extra lives for mega health
- if (self.items & ITEM_HealthMega.m_itemid)
+ if(self.itemdef == ITEM_ExtraLife)
{
Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_EXTRALIVES);
PlayerScore_Add(other, SP_LMS_LIVES, autocvar_g_lms_extra_lives);
+ return MUT_ITEMTOUCH_PICKUP;
}
return MUT_ITEMTOUCH_CONTINUE;
}
}
-void SUB_Remove();
-
void pathlib_showsquare(vector where,float goodsquare,float _lifetime)
{
entity s;
s = spawn();
s.alpha = 0.25;
- s.think = SUB_Remove;
+ s.think = SUB_Remove_self;
s.nextthink = _lifetime;
s.scale = pathlib_gridsize / 512.001;
s.solid = SOLID_NOT;
e = spawn();
e.alpha = 0.25;
- e.think = SUB_Remove;
+ e.think = SUB_Remove_self;
e.nextthink = _lifetime;
e.scale = pathlib_gridsize / 512;
e.solid = SOLID_NOT;
e = findchainentity(owner, start);
while(e)
{
- e.think = SUB_Remove;
+ e.think = SUB_Remove_self;
e.nextthink = time;
e = e.chain;
}
void dumpnode(entity n)
{
n.is_path_node = false;
- n.think = SUB_Remove;
+ n.think = SUB_Remove_self;
n.nextthink = time;
}
node = spawn();
- node.think = SUB_Remove;
+ node.think = SUB_Remove_self;
node.nextthink = time + PATHLIB_NODEEXPIRE;
node.is_path_node = true;
node.owner = openlist;
{
if (i == RANKINGS_CNT)
{
- db_put(ServerProgsDB, strcat(map, rr, "time", ftos(i)), string_null);
- db_put(ServerProgsDB, strcat(map, rr, "crypto_idfp", ftos(i)), string_null);
+ db_remove(ServerProgsDB, strcat(map, rr, "time", ftos(i)));
+ db_remove(ServerProgsDB, strcat(map, rr, "crypto_idfp", ftos(i)));
}
else
{
if(this.angles != '0 0 0')
this.SendFlags |= ISF_ANGLES;
- this.reset = Item_Reset_self;
+ this.reset = Item_Reset;
// it's a level item
if(this.spawnflags & 1)
this.noalign = 1;
else if (targ.classname == "item_health_mega")
self.health = 200;
//remove(targ); // removing ents in init functions causes havoc, workaround:
- targ.think = SUB_Remove;
+ targ.think = SUB_Remove_self;
targ.nextthink = time;
}
self.spawnflags = 2;