From: MirceaKitsune Date: Mon, 18 Jul 2011 10:54:37 +0000 (+0300) Subject: Further progress on the belly mass system X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ac1c92513da7faadcd93e9e10ec039b926020107;p=voretournament%2Fvoretournament.git Further progress on the belly mass system --- diff --git a/data/balanceVT.cfg b/data/balanceVT.cfg index a4e7bb1a..bcd266c5 100644 --- a/data/balanceVT.cfg +++ b/data/balanceVT.cfg @@ -187,6 +187,8 @@ set g_balance_grabber_reload_time 2 // {{{ stomach set g_balance_vore_load_capacity 100 "capacity percent a player's stomach has, influenced by player size" set g_balance_vore_load_mass 30 "prey mass, influenced by player size" +set g_balance_vore_weight_gravity 1 "you get this heavier the more you eat, at 1 each meal makes you two times heavier" +set g_balance_vore_weight_speed 0.15 "you get this slower the more you eat, at 0.5 each meal makes you two times slower" set g_balance_vore_swallow_range 140 "distance below which you can swallow another player when facing them" set g_balance_vore_swallow_speed_fill 2.5 "how long it takes to swallow a player, 0 is instant" set g_balance_vore_swallow_speed_fill_scalediff 0.5 "fill rate depends on predator size compared to prey size by this amount" @@ -213,8 +215,6 @@ set g_balance_vore_digestion_distribute 1 "if enabled, digestion is reduced by t set g_balance_vore_digestion_scalediff 0.5 "if enabled, digestion damage is affected by the size of the predator compared to the size of the prey by this amount" set g_balance_vore_teamheal 1 "when enabled, having a team mate in your stomach will keep healing them by this amount" set g_balance_vore_teamheal_stable 150 "maximum amount of health you can gain from a teamheal (best kept equal or less than g_balance_health_rotstable)" -set g_balance_vore_weight_gravity 1 "you get this heavier the more you eat, at 1 each meal makes you two times heavier" -set g_balance_vore_weight_speed 0.15 "you get this slower the more you eat, at 0.5 each meal makes you two times slower" set g_balance_vore_kick_damage 30 "amount of damage you can do during stomach kick" set g_balance_vore_kick_delay 0.6 "how many seconds must pass before you can perform another stomach kick" set g_balance_vore_kick_force 420 "predators are pushed by this amount when stomach kicked, in the direction their prey is facing" diff --git a/data/qcsrc/server/bot/havocbot/vore_ai.qc b/data/qcsrc/server/bot/havocbot/vore_ai.qc index b46f5a2f..c3d1c1bd 100644 --- a/data/qcsrc/server/bot/havocbot/vore_ai.qc +++ b/data/qcsrc/server/bot/havocbot/vore_ai.qc @@ -141,9 +141,9 @@ void Vore_AI() if(!cvar("g_vore_reversescoring")) // when reverse scoring is on, it's in the interest of the prey to get eaten, so the predator has nothing to fear { if(skill >= 3) // make bots aware of this from skill 3 and up - fear *= 1 + self.stomach_load; // the bigger our stomach, the less we want to put someone else in there + fear *= 1 + self.stomach_maxload / self.stomach_load; // the bigger our stomach, the less we want to put someone else in there if(skill >= 5) // make bots aware of this from skill 5 and up - fear *= 1 + prey.stomach_load; // predators fear prey that have a large stomach + fear *= 1 + prey.stomach_maxload / prey.stomach_load; // predators fear prey that have a large stomach if(cvar("g_healthsize")) fear *= (prey.scale / self.scale); // predators fear larger prey and are courageous toward smaller prey diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index eaa93cf8..eca3ad9f 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -436,9 +436,9 @@ string setmodel_state() newmodel_extension = substring(self.playermodel, strlen(self.playermodel) - 4, 4); float vore_state; - if(self.stomach_load > self.stat_stomachmaxload * 0.6) + if(self.stomach_load > self.stomach_maxload * 0.6) vore_state = 3; - else if(self.stomach_load > self.stat_stomachmaxload * 0.3) + else if(self.stomach_load > self.stomach_maxload * 0.3) vore_state = 2; else if(self.stomach_load) vore_state = 1; @@ -2106,7 +2106,7 @@ void SpectateCopy(entity spectatee) { self.stomach_load = spectatee.stomach_load; self.stat_eaten = spectatee.stat_eaten; self.stat_stomachload = spectatee.stat_stomachload; - self.stat_stomachmaxload = spectatee.stat_stomachmaxload; + self.stomach_maxload = spectatee.stomach_maxload; self.stat_digesting = spectatee.stat_digesting; self.stat_canleave = spectatee.stat_canleave; self.stat_canswallow = spectatee.stat_canswallow; diff --git a/data/qcsrc/server/cl_physics.qc b/data/qcsrc/server/cl_physics.qc index 4394bdba..7d916fd4 100644 --- a/data/qcsrc/server/cl_physics.qc +++ b/data/qcsrc/server/cl_physics.qc @@ -508,7 +508,7 @@ void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float acce accelqw = -accelqw; if(cvar("g_balance_vore_weight_gravity") > 0) // apply stomach weight - wishspeed *= 1 - bound(0, self.stomach_load * cvar("g_balance_vore_weight_speed"), 1); + wishspeed *= 1 - bound(0, self.stomach_maxload / self.stomach_load * cvar("g_balance_vore_weight_speed"), 1); if(cvar("g_healthsize")) // if we are smaller or larger, we run slower or faster wishspeed *= (1 - cvar("g_healthsize_movementfactor")) + cvar("g_healthsize_movementfactor") * self.scale; if(self.swallow_progress_prey) // cut speed based on swallow progress for prey diff --git a/data/qcsrc/server/cl_player.qc b/data/qcsrc/server/cl_player.qc index abc50c15..411499c4 100644 --- a/data/qcsrc/server/cl_player.qc +++ b/data/qcsrc/server/cl_player.qc @@ -1332,7 +1332,7 @@ void GlobalSound(string sample, float chan, float voicetype) break; case VOICETYPE_GURGLE: if(self.stomach_load) - sound(self, chan, sample, bound(0, vol * (self.stomach_load / self.stat_stomachmaxload), 1), ATTN_NORM); + sound(self, chan, sample, bound(0, vol * (self.stomach_load / self.stomach_maxload), 1), ATTN_NORM); else stopsound(self, chan); break; diff --git a/data/qcsrc/server/defs.qh b/data/qcsrc/server/defs.qh index 70b421ef..11d295d2 100644 --- a/data/qcsrc/server/defs.qh +++ b/data/qcsrc/server/defs.qh @@ -69,7 +69,7 @@ float maxclients; .entity fakepredator; .float swallow_progress_prey, swallow_progress_pred; .float digesting; -.float stomach_load; +.float stomach_load, stomach_maxload; .float weapon_delay; .float fakeprey; .float stat_eaten, stat_stomachload, stat_stomachmaxload, stat_digesting, stat_canleave, stat_canswallow; diff --git a/data/qcsrc/server/g_world.qc b/data/qcsrc/server/g_world.qc index d96b63e7..331e3a68 100644 --- a/data/qcsrc/server/g_world.qc +++ b/data/qcsrc/server/g_world.qc @@ -659,7 +659,7 @@ void spawnfunc_worldspawn (void) addstat(STAT_LAST_PICKUP, AS_FLOAT, last_pickup); addstat(STAT_WINNING, AS_FLOAT, winning); addstat(STAT_VORE_LOAD, AS_INT, stat_stomachload); - addstat(STAT_VORE_MAXLOAD, AS_INT, stat_stomachmaxload); + addstat(STAT_VORE_MAXLOAD, AS_INT, stomach_maxload); addstat(STAT_VORE_CANSWALLOW, AS_INT, stat_canswallow); addstat(STAT_VORE_DIGESTING, AS_INT, stat_digesting); addstat(STAT_VORE_EATEN, AS_INT, stat_eaten); diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index 848ddaf9..a62036c0 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -47,7 +47,7 @@ float Swallow_condition_check(entity prey) swallow_complain = "You cannot swallow your team mates\n"; else if(!cvar("g_vore_spawnshield") && prey.spawnshieldtime > time) swallow_complain = "You cannot swallow someone protected by the spawn shield\n"; - else if(self.stomach_load >= self.stat_stomachmaxload) + else if(self.stomach_load >= self.stomach_maxload) swallow_complain = "You do not have any more room to swallow this player.\n"; else if(cvar("g_vore_biggergut") && prey.stomach_load > self.stomach_load) swallow_complain = "You cannot swallow someone with a bigger stomach than yours\n"; @@ -191,7 +191,7 @@ void Vore_WeightApply(entity e) // slowing the player is done in cl_physics.qc if(e.stomach_load != e.vore_oldstomachload) - e.gravity += 1 + (e.stomach_load * cvar("g_balance_vore_weight_gravity") - e.vore_oldstomachload); + e.gravity += 1 + (e.stomach_maxload / e.stomach_load * cvar("g_balance_vore_weight_gravity") - e.vore_oldstomachload); if(e.gravity == 0) e.gravity = 0.00001; // 0 becomes 1 for gravity, so do this to allow 0 gravity e.vore_oldstomachload = e.stomach_load; @@ -507,15 +507,15 @@ void Vore_Digest() if(time > self.digestion_step) { - // if distributed digestion is enabled, reduce digestion strength by the number of prey in our stomach - float reduce; + // if distributed digestion is enabled, reduce digestion strength by the amount of prey in our stomach + float vore_offset; if(cvar("g_balance_vore_digestion_distribute")) - reduce = self.predator.stomach_load; + vore_offset = self.predator.stomach_maxload / self.predator.stomach_load; else - reduce = 1; + vore_offset = 1; float damage; - damage = cvar("g_balance_vore_digestion_damage") / reduce; + damage = cvar("g_balance_vore_digestion_damage") / vore_offset; // apply player scale to digestion damage if(cvar("g_healthsize") && cvar("g_balance_vore_digestion_scalediff")) @@ -523,7 +523,7 @@ void Vore_Digest() Damage(self, self.predator, self.predator, damage, DEATH_DIGESTION, self.origin, '0 0 0'); if(cvar("g_balance_vore_digestion_vampire") && self.predator.health < cvar("g_balance_vore_digestion_vampire_stable")) - self.predator.health += cvar("g_balance_vore_digestion_vampire") / reduce; + self.predator.health += cvar("g_balance_vore_digestion_vampire") / vore_offset; if (self.predator.digestsound_finished < time) { @@ -717,20 +717,14 @@ void Vore() else if(self.predator.classname == "player") { self.stat_stomachload = self.predator.stomach_load; // necessary for the stomach board - self.stat_stomachmaxload = self.predator.stat_stomachmaxload; // necessary for the stomach board + self.stat_stomachmaxload = self.predator.stomach_maxload; // necessary for the stomach board self.stat_digesting = self.predator.digesting; // necessary for the stomach board self.stat_eaten = num_for_edict(self.predator); } else { - float vore_capacity; - vore_capacity = cvar("g_balance_vore_load_capacity"); - if(cvar("g_healthsize")) - vore_capacity *= self.scale; - vore_capacity = ceil(vore_capacity); - self.stat_stomachload = self.stomach_load; - self.stat_stomachmaxload = vore_capacity; + self.stat_stomachmaxload = self.stomach_maxload; self.stat_digesting = self.digesting; self.stat_eaten = 0; } @@ -800,6 +794,12 @@ void Vore() entity prey; prey = Swallow_player_check(); + // set the predator's stomach capacity + self.stomach_maxload = cvar("g_balance_vore_load_capacity"); + if(cvar("g_healthsize")) + self.stomach_maxload *= self.scale; + self.stomach_maxload = ceil(self.stomach_maxload); + // attempt to swallow our new prey if we pressed the attack button, and there's any in range self.stat_canswallow = 0; if(Swallow_condition_check(prey))