Skip to content

Commit

Permalink
fix: typo prize
Browse files Browse the repository at this point in the history
  • Loading branch information
rick-yao committed Dec 23, 2024
1 parent 10f6f1f commit 1f68b44
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion l4d2_tank_draw/cfg/l4d2_tank_draw.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ l4d2_tank_draw_new_witch_chance "30"
// Probability of receiving no reward
// -
// Default: "10"
l4d2_tank_draw_no_price_chance "10"
l4d2_tank_draw_no_prize_chance "10"

// 重置所有人血量概率(将所有人血量设置为100,清空倒地次数记数)
// Probability of resetting all survivors' health to 100 and clearing incapacitation counters
Expand Down
2 changes: 1 addition & 1 deletion l4d2_tank_draw/scripting/l4d2_tank_draw.sp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void OnPluginStart()
ChanceNewTank = CreateConVar("l4d2_tank_draw_new_tank_chance", "0", "获得tank概率 \nProbability of spawning a new tank", FCVAR_NONE);
ChanceNewWitch = CreateConVar("l4d2_tank_draw_new_witch_chance", "0", "获得witch概率 \nProbability of spawning a new witch", FCVAR_NONE);

ChanceNoPrice = CreateConVar("l4d2_tank_draw_no_price_chance", "10", "没有奖励的概率 \nProbability of receiving no reward", FCVAR_NONE);
ChanceNoPrize = CreateConVar("l4d2_tank_draw_no_prize_chance", "10", "没有奖励的概率 \nProbability of receiving no reward", FCVAR_NONE);

ChanceReviveAllDead = CreateConVar("l4d2_tank_draw_revive_all_dead_chance", "0", "全体复活概率 \nProbability of reviving all dead survivors", FCVAR_NONE);

Expand Down
2 changes: 1 addition & 1 deletion l4d2_tank_draw/scripting/lib/lib.sp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ConVar
// Custom ConVars for the plugin
ConVar
TankDrawEnable,
ChanceNoPrice,
ChanceNoPrize,
ChanceIncreaseHealth,
ChanceInfiniteAmmo,
ChanceInfiniteMelee,
Expand Down
6 changes: 3 additions & 3 deletions l4d2_tank_draw/scripting/lib/lucky_draw.sp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
stock Action LuckyDraw(int victim, int attacker)
{
int chanceNoPrice = ChanceNoPrice.IntValue;
int chanceNoPrize = ChanceNoPrize.IntValue;
int chanceIncreaseHealth = ChanceIncreaseHealth.IntValue;
int chanceInfiniteAmmo = ChanceInfiniteAmmo.IntValue;
int chanceInfiniteMelee = ChanceInfiniteMelee.IntValue;
Expand All @@ -25,7 +25,7 @@ stock Action LuckyDraw(int victim, int attacker)
int chanceClearAllSurvivorHealth = ChanceClearAllSurvivorHealth.IntValue;
int chanceReviveAllDead = ChanceReviveAllDead.IntValue;

int totalChance = chanceNoPrice + chanceResetAllSurvivorHealth + chanceInfinitePrimaryAmmo + chanceNewWitch + chanceFreezeBomb + chanceTimerBomb + chanceReviveAllDead + chanceNewTank + chanceDisarmSingleSurvivor + chanceDisarmAllSurvivor + chanceDecreaseHealth + chanceClearAllSurvivorHealth + chanceIncreaseHealth + chanceInfiniteAmmo + chanceInfiniteMelee + chanceAverageHealth + chanceKillAllSurvivor + chanceKillSingleSurvivor + chanceDisableGlow;
int totalChance = chanceNoPrize + chanceResetAllSurvivorHealth + chanceInfinitePrimaryAmmo + chanceNewWitch + chanceFreezeBomb + chanceTimerBomb + chanceReviveAllDead + chanceNewTank + chanceDisarmSingleSurvivor + chanceDisarmAllSurvivor + chanceDecreaseHealth + chanceClearAllSurvivorHealth + chanceIncreaseHealth + chanceInfiniteAmmo + chanceInfiniteMelee + chanceAverageHealth + chanceKillAllSurvivor + chanceKillSingleSurvivor + chanceDisableGlow;
totalChance += chanceLimitedTimeWorldMoonGravity + chanceMoonGravityOneLimitedTime + chanceWorldMoonGravityToggle + chanceIncreaseGravity;

if (totalChance == 0)
Expand All @@ -44,7 +44,7 @@ stock Action LuckyDraw(int victim, int attacker)
int currentChance = 0;

// no prize
currentChance += chanceNoPrice;
currentChance += chanceNoPrize;
if (random <= currentChance)
{
CPrintToChatAll("%t", "TankDrawResult_NoPrize", attackerName);
Expand Down

0 comments on commit 1f68b44

Please sign in to comment.