From: MirceaKitsune Date: Mon, 18 Jul 2011 14:36:06 +0000 (+0300) Subject: Randomize the position of prey in the stomach, now that there is no hard coded limit... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=eb28531686b9ff82a1d877f020c811e78175aa41;p=voretournament%2Fvoretournament.git Randomize the position of prey in the stomach, now that there is no hard coded limit on how many players you can eat (so there can't be 9 spots any more). --- diff --git a/data/balanceVT.cfg b/data/balanceVT.cfg index e3ea3576..0cba3cb2 100644 --- a/data/balanceVT.cfg +++ b/data/balanceVT.cfg @@ -185,6 +185,7 @@ set g_balance_grabber_reload_time 2 // }}} // {{{ stomach +set g_balance_vore_action_delay 1 "how many seconds must pass before you can swallow or regurgitate again, after swallowing or regurgitating another player" set g_balance_vore_load_pred_capacity 100 "capacity percent a player's stomach has, influenced by player size" set g_balance_vore_load_pred_weight 1 "you get this heavier the more you eat, at 1 a full belly makes you two times heavier" set g_balance_vore_load_pred_speed 1 "you get this slower the more you eat, at 1 a full belly makes you two times slower" @@ -207,7 +208,6 @@ set g_balance_vore_regurgitate_force 600 "regurgitated players rocket out at thi set g_balance_vore_regurgitate_predatorforce 450 "players are pushed back by this amount when regurgitating someone, opposite of the direction they are facing" set g_balance_vore_regurgitate_delay 0.5 "regurgitation delay" set g_balance_vore_regurgitate_punchangle 12 "your view gets tilted by this amount when regurgitating someone" -set g_balance_vore_action_delay 1 "how many seconds must pass before you can swallow or regurgitate again, after swallowing or regurgitating another player" set g_balance_vore_digestion_damage 4 "amount of damage applied to victims during digestion" set g_balance_vore_digestion_vampire 1 "amount of health you gain from digestion" set g_balance_vore_digestion_vampire_stable 150 "maximum amount of health you can gain from digestion (best kept equal or less than g_balance_health_rotstable)" diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index 37d62074..fa499430 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -99,65 +99,31 @@ float Vore_CanLeave() } // position the camera properly for prey -void Vore_SetPreyPositions() +void Vore_SetPreyPositions(entity pred) { - // self is the predator and head is the prey + // pred is the predator and head is the prey local entity head; local vector origin_apply; - local float position_counter; // In order to allow prey to see each other in the stomach, we must position each occupant differently, - // else all players overlap in the center. To do this, we run a loop on all players in the same stomach. - // For each player, the origin is updated, then a new origin is used for the next player. - // This requires that no more than 9 players may be in the stomach at a time! + // else all players overlap in the center. To do this, we use a random origin on all players in the same stomach. FOR_EACH_PLAYER(head) { - if(head.predator == self) + if(head.predator == pred) { - switch(position_counter) - { - case 0: - origin_apply = '0 0 0'; // first occupant sits in the middle - break; - case 1: - origin_apply = '1 0 0'; // second occupant sits in the front - break; - case 2: - origin_apply = '-1 0 0'; // third occupant sits in the back - break; - case 3: - origin_apply = '0 1 0'; // fourth occupant sits in the right - break; - case 4: - origin_apply = '0 -1 0'; // fifth occupant sits in the left - break; - case 5: - origin_apply = '1 1 0'; // sixth occupant sits in the front-right - break; - case 6: - origin_apply = '-1 1 0'; // seventh occupant sits in the back-right - break; - case 7: - origin_apply = '1 -1 0'; // eigth occupant sits in the front-left - break; - case 8: - origin_apply = '-1 -1 0'; // ninth occupant sits in the back-left - break; - default: - break; - } + origin_apply_x = PL_PREY_VIEW_OFS_x + crandom() * cvar("g_vore_neighborprey_distance"); + origin_apply_y = PL_PREY_VIEW_OFS_y + crandom() * cvar("g_vore_neighborprey_distance"); + origin_apply_z = PL_PREY_VIEW_OFS_z; // since prey have their predators set as an aiment, view_ofs will specify the real origin of prey, not just the view offset - head.view_ofs = PL_PREY_VIEW_OFS + origin_apply * cvar("g_vore_neighborprey_distance"); - head.view_ofs_z *= self.scale; // stomach center depends on predator scale + head.view_ofs = origin_apply; + head.view_ofs_z *= pred.scale; // stomach center depends on predator scale // change prey height based on scale float prey_height; - prey_height = (head.scale - self.scale) * cvar("g_healthsize_vore_pos"); + prey_height = (head.scale - pred.scale) * cvar("g_healthsize_vore_pos"); head.view_ofs_z += prey_height; - - position_counter += 1; } } } @@ -333,6 +299,7 @@ void Vore_Swallow(entity e) e.predator.spawnshieldtime = 0; // lose spawn shield when we vore e.predator.hitsound += 1; // play this for team mates too, as we could be swallowing them to heal them Vore_AutoDigest(e.predator); + Vore_SetPreyPositions(e.predator); // block firing for a small amount of time, or we'll be firing the next frame after we swallow e.predator.weapon_delay = time + button_delay_time; @@ -420,6 +387,7 @@ void Vore_Regurgitate(entity e) e.predator.punchangle_x += cvar("g_balance_vore_regurgitate_punchangle"); e.predator.regurgitate_prepare = 0; e.predator.action_delay = time + cvar("g_balance_vore_action_delay"); + Vore_SetPreyPositions(e.predator); // block firing for a small amount of time, or we'll be firing the next frame e.weapon_delay = time + button_delay_time; @@ -437,6 +405,7 @@ void Vore_DeadPrey_Configure(entity e) // this entity is like e.predator but for dead prey, to avoid conflicts e.fakepredator = e.predator; e.fakeprey = TRUE; + Vore_SetPreyPositions(e.predator); // first release the prey from the predator, as dead prey needs to be attached differently // the predator's stomach load is also decreased, as dead prey doesn't count any more @@ -863,8 +832,6 @@ void Vore() // Code that addresses the prey: // -------------------------------- - Vore_SetPreyPositions(); - // keepdeadprey - detach dead prey if their predator died or got swallowed if(self.fakeprey) if(self.fakepredator.deadflag != DEAD_NO || self.fakepredator.stat_eaten)