Skip to content

Commit

Permalink
#230 - code complete
Browse files Browse the repository at this point in the history
Just needs BGM and translations
  • Loading branch information
safalin1 committed Sep 26, 2021
1 parent 4e61673 commit c32466b
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/data/microtf2/Minigames.txt
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
"enabled" "1"
"BackgroundMusic" "gemidyne/warioware/{version}/minigames/bgm/23.mp3"
"EntryPoint" "Minigame23_EntryPoint"
"BackgroundMusic_Length" "4.101188"
"BackgroundMusic_Length" "6.0"
}
"24"
{
Expand Down
22 changes: 20 additions & 2 deletions src/scripting/Minigames/Minigame23.sp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,23 @@

public void Minigame23_EntryPoint()
{
g_pfOnMinigameSelectedPre.AddFunction(INVALID_HANDLE, Minigame23_OnMinigameSelectedPre);
g_pfOnMinigameSelected.AddFunction(INVALID_HANDLE, Minigame23_OnMinigameSelected);
g_pfOnPlayerDeath.AddFunction(INVALID_HANDLE, Minigame23_OnPlayerDeath);
g_pfOnPlayerTakeDamage.AddFunction(INVALID_HANDLE, Minigame23_OnPlayerTakeDamage);
}

public void Minigame23_OnMinigameSelectedPre()
{
if (g_iActiveMinigameId != 23)
{
return;
}

g_bIsBlockingTaunts = false;
g_bIsBlockingKillCommands = false;
}

public void Minigame23_OnMinigameSelected(int client)
{
if (g_iActiveMinigameId != 23)
Expand All @@ -30,6 +42,7 @@ public void Minigame23_OnMinigameSelected(int client)
player.Class = TFClass_Soldier;
player.RemoveAllWeapons();
player.GiveWeapon(775);
player.SetGodMode(false);
}
}

Expand All @@ -55,7 +68,7 @@ public void Minigame23_OnPlayerDeath(int victimId, int attackerId)
}
}

public DamageBlockResults Minigame23_OnPlayerTakeDamage(int victimId, int attackerId, float damage, int damageType)
public DamageBlockResults Minigame23_OnPlayerTakeDamage(int victimId, int attackerId, float damage, int damageCustom)
{
if (g_bIsMinigameActive && g_iActiveMinigameId == 23)
{
Expand All @@ -65,9 +78,14 @@ public DamageBlockResults Minigame23_OnPlayerTakeDamage(int victimId, int attack
bool victimValid = victim.IsValid && victim.IsParticipating;
bool attackerValid = attacker.IsValid && attacker.IsParticipating;

if (attackerValid && victimValid && victim.ClientId != attacker.ClientId && damageType == TF_CUSTOM_TAUNT_GRENADE)
PrintToChatAll("Minigame23_OnPlayerTakeDamage: damageCustom is %i (looking for %i)", damageCustom, TF_CUSTOM_TAUNT_GRENADE);

if (attackerValid && victimValid && victim.ClientId != attacker.ClientId && damageCustom == TF_CUSTOM_TAUNT_GRENADE)
{
attacker.TriggerSuccess();

PrintToChatAll("Minigame23_OnPlayerTakeDamage: attacker success (%i)", attacker.ClientId);

return EDamageBlockResult_AllowDamage;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/translations/de/microtf2.phrases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@
}
"Minigame23_Caption"
{
"de" "DOPPEL SPRUNG!"
"de" "TAUNT KILL!"
}
"Minigame24_Caption"
{
Expand Down
2 changes: 1 addition & 1 deletion src/translations/es/microtf2.phrases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@
}
"Minigame23_Caption"
{
"es" "¡SALTO DOBLE!"
"es" "TAUNT KILL!"
}
"Minigame24_Caption"
{
Expand Down
2 changes: 1 addition & 1 deletion src/translations/fr/microtf2.phrases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@
}
"Minigame23_Caption"
{
"fr" "DOUBLE SAUT !"
"fr" "TAUNT KILL!"
}
"Minigame24_Caption"
{
Expand Down
2 changes: 1 addition & 1 deletion src/translations/it/microtf2.phrases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@
}
"Minigame23_Caption"
{
"it" "DOPPIO SALTO!"
"it" "TAUNT KILL!"
}
"Minigame24_Caption"
{
Expand Down
2 changes: 1 addition & 1 deletion src/translations/microtf2.phrases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@
}
"Minigame23_Caption"
{
"en" "DOUBLE JUMP!"
"en" "TAUNT KILL!"
}
"Minigame24_Caption"
{
Expand Down
2 changes: 1 addition & 1 deletion src/translations/pl/microtf2.phrases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@
}
"Minigame23_Caption"
{
"pl" "WYKONAJ PODWÓJNY SKOK!"
"pl" "TAUNT KILL!"
}
"Minigame24_Caption"
{
Expand Down
2 changes: 1 addition & 1 deletion src/translations/pt/microtf2.phrases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@
}
"Minigame23_Caption"
{
"pt" "SALTO DUPLO!"
"pt" "TAUNT KILL!"
}
"Minigame24_Caption"
{
Expand Down
2 changes: 1 addition & 1 deletion src/translations/pt_p/microtf2.phrases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@
}
"Minigame23_Caption"
{
"pt_p" "SALTO DUPLO!"
"pt_p" "TAUNT KILL!"
}
"Minigame24_Caption"
{
Expand Down
2 changes: 1 addition & 1 deletion src/translations/ru/microtf2.phrases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@
}
"Minigame23_Caption"
{
"ru" "ДВОЙНОЙ ПРЫЖОК!"
"ru" "TAUNT KILL!"
}
"Minigame24_Caption"
{
Expand Down

0 comments on commit c32466b

Please sign in to comment.