From: unknown Date: Sun, 21 Nov 2010 20:42:05 +0000 (-0500) Subject: Finally a functioning HUD! Now all I need is a new keepawayball_carrying.tga image... X-Git-Tag: xonotic-v0.1.0preview~86^2~2^2~1^2~22 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3927502aee513b305d6bbb261123b5b0797f6dd5;p=xonotic%2Fxonotic-data.pk3dir.git Finally a functioning HUD! Now all I need is a new keepawayball_carrying.tga image. (Morphed?) --- diff --git a/qcsrc/server/mutators/gamemode_keepaway.qc b/qcsrc/server/mutators/gamemode_keepaway.qc index 8f200dcd6..e8ec55b1e 100644 --- a/qcsrc/server/mutators/gamemode_keepaway.qc +++ b/qcsrc/server/mutators/gamemode_keepaway.qc @@ -2,7 +2,6 @@ void ka_SpawnBall(void); void ka_TouchEvent(void); void ka_RespawnBall(void); void ka_DropEvent(entity); -void ka_UpdateState(entity); void ka_Initialize() { @@ -46,11 +45,9 @@ void ka_SpawnBall() // self = the ball self.flags = FL_ITEM; //self.reset = ka_Reset; self.owner = world; - - //WaypointSprite_AttachCarrier("ka-ball", self); + WaypointSprite_Spawn("ka-ball", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, FALSE); WaypointSprite_UpdateTeamRadar(self.waypointsprite_attachedforcarrier, RADARICON_FLAGCARRIER, '0 1 1'); - // wtf radar doesn't work when not in a team environment? } void ka_RespawnBall() @@ -104,10 +101,7 @@ void ka_TouchEvent() other.effects |= 8; other.alpha = 0.6; - ka_UpdateState(other); - bprint(other.netname, "^7 has picked up the ball!\n"); - if(other.items & IT_KEY1) { bprint(other.netname, "^7 has the ball in their inventory.\n"); } WriteByte(MSG_BROADCAST, SVC_CENTERPRINT); WriteString(MSG_BROADCAST, strcat("\n\n", other.netname, "^7 has picked up the ball!\n")); sound(self.owner, CHAN_AUTO, "keepaway/pickedup.wav", VOL_BASE, ATTN_NONE); @@ -144,10 +138,7 @@ void ka_DropEvent(entity plyr) ball.owner.kaballcarried = world; ball.owner = world; - ka_UpdateState(plyr); - bprint(plyr.netname, "^7 has dropped the ball!\n"); - if(plyr.items & IT_KEY1) { bprint(plyr.netname, "^7 has the ball in their inventory.\n"); } WriteByte(MSG_BROADCAST, SVC_CENTERPRINT); WriteString(MSG_BROADCAST, strcat("\n\n", plyr.netname, "^7 has dropped the ball!\n")); sound(other, CHAN_AUTO, "keepaway/dropped.wav", VOL_BASE, ATTN_NONE); @@ -161,13 +152,6 @@ void ka_DropEvent(entity plyr) WaypointSprite_Kill(plyr.waypointsprite_attachedforcarrier); } -void ka_UpdateState(entity plyr) -{ - if(plyr.kaballcarried) { - plyr.items |= IT_KEY1; - } -} - MUTATOR_HOOKFUNCTION(ka_RemovePlayer) { if(self.kaballcarried) { ka_DropEvent(self); } @@ -191,8 +175,6 @@ MUTATOR_HOOKFUNCTION(ka_Scoring) PlayerScore_Add(frag_attacker, SP_KEEPAWAY_SCORE, 1); } - if(self.items & IT_KEY1) { bprint(self.netname, "^7 has the ball in their inventory.\n"); } - if(self.kaballcarried) { ka_DropEvent(self); } return 1; } @@ -205,19 +187,14 @@ MUTATOR_HOOKFUNCTION(ka_GiveFragsForKill) MUTATOR_HOOKFUNCTION(ka_PlayerPreThink) { + self.items &~= IT_KEY1; + if(self.kaballcarried) { self.items |= IT_KEY1; } - //if(self.items & IT_KEY1) { bprint(self.netname, "^7 has the ball in their inventory.\n"); } return 1; } -//MUTATOR_HOOKFUNCTION(ka_SpectateCopy) -//{ -// self.items = other.items; -// return 1; -//} - MUTATOR_DEFINITION(gamemode_keepaway) { MUTATOR_HOOK(MakePlayerObserver, ka_RemovePlayer, CBC_ORDER_ANY); @@ -225,7 +202,6 @@ MUTATOR_DEFINITION(gamemode_keepaway) MUTATOR_HOOK(PlayerDies, ka_Scoring, CBC_ORDER_ANY); MUTATOR_HOOK(GiveFragsForKill, ka_GiveFragsForKill, CBC_ORDER_FIRST); MUTATOR_HOOK(PlayerPreThink, ka_PlayerPreThink, CBC_ORDER_FIRST); - //MUTATOR_HOOK(SpectateCopy, ka_SpectateCopy, CBC_ORDER_ANY); MUTATOR_ONADD {