Skip to content

Commit

Permalink
[MIRROR] Fixes to battle arcade (#1994)
Browse files Browse the repository at this point in the history
* Fixes to battle arcade (#82620)

## About The Pull Request

Added gear for world nine, removed the "Gear" gear that did nothing.
Made counterattacks to kill an enemy properly kill the enemy.
I renamed some gear items to fit the theme of the area they are unlocked
in just as a small thing.

## Why It's Good For The Game

Closes tgstation/tgstation#82613

## Changelog

:cl:
fix: Battle arcade's higher levels no longer gives you a "Gear" gear,
and counterattacks can now properly kill enemies.
/:cl:

* Fixes to battle arcade

---------

Co-authored-by: John Willard <[email protected]>
  • Loading branch information
2 people authored and StealsThePRs committed Apr 15, 2024
1 parent 811c697 commit 3e38964
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
10 changes: 7 additions & 3 deletions code/game/machinery/computer/arcade/battle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@
if(isnull(battle_arcade_gear_list))
var/list/all_gear = list()
for(var/datum/battle_arcade_gear/template as anything in subtypesof(/datum/battle_arcade_gear))
if(!(template::slot)) //needs to fit in something.
continue
all_gear[template::name] = new template
battle_arcade_gear_list = all_gear

Expand Down Expand Up @@ -216,7 +218,7 @@
message_admins("[ADMIN_LOOKUPFLW(usr)] has outbombed Cuban Pete and been awarded a bomb.")
usr.log_message("outbombed Cuban Pete and has been awarded a bomb.", LOG_GAME)
else
to_chat(user, span_notice("[src] dispenses 2 tickets!"))
visible_message(span_notice("[src] dispenses 2 tickets!"))
new /obj/item/stack/arcadeticket((get_turf(src)), 2)
player_gold += enemy_gold_reward
if(user)
Expand Down Expand Up @@ -282,12 +284,14 @@
process_enemy_turn(user)

///Called when you successfully counterattack the enemy.
/obj/machinery/computer/arcade/battle/proc/successful_counterattack()
/obj/machinery/computer/arcade/battle/proc/successful_counterattack(mob/user)
var/datum/battle_arcade_gear/weapon = equipped_gear[WEAPON_SLOT]
var/damage_dealt = (rand(20, 30) * (!isnull(weapon) ? weapon.bonus_modifier : 1))
enemy_hp -= round(max(0, damage_dealt), 1)
feedback_message = "User counterattacked for [damage_dealt] damage!"
playsound(loc, 'sound/arcade/boom.ogg', 40, TRUE, extrarange = -3)
if(enemy_hp <= 0)
on_battle_win(user)
SStgui.update_uis(src)

///Handles the delay between the user's and enemy's turns to process what's going on.
Expand Down Expand Up @@ -346,7 +350,7 @@
var/chance_at_counterattack = 40 + (skill_level * 5) //at level 1 this is 45, at legendary this is 75
var/damage_dealt = (defending_flags & BATTLE_ATTACK_FLAG_DEFEND) ? rand(5, 10) : rand(15, 20)
if((defending_flags & BATTLE_ATTACK_FLAG_COUNTERATTACK) && prob(chance_at_counterattack))
return successful_counterattack()
return successful_counterattack(user)
return user_take_damage(user, damage_dealt)

/obj/machinery/computer/arcade/battle/ui_data(mob/user)
Expand Down
21 changes: 17 additions & 4 deletions code/game/machinery/computer/arcade/battle_gear.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
///The name of the gear, used in shops.
var/name = "Gear"
///The slot this gear fits into
var/slot = WEAPON_SLOT
var/slot
///The world the player has to be at in order to buy this item.
var/world_available
///The stat given by the gear
Expand Down Expand Up @@ -95,19 +95,32 @@
bonus_modifier = 4

/datum/battle_arcade_gear/tier_7/armor
name = "Celestial Armor"
name = "Ethereal Armor"
slot = ARMOR_SLOT
bonus_modifier = 4

/datum/battle_arcade_gear/tier_8
world_available = BATTLE_WORLD_EIGHT

/datum/battle_arcade_gear/tier_8/weapon
name = "Gungnir"
slot = WEAPON_SLOT
bonus_modifier = 4.5

/datum/battle_arcade_gear/tier_8/armor
name = "Celestial Armor"
slot = ARMOR_SLOT
bonus_modifier = 4.5

/datum/battle_arcade_gear/tier_9
world_available = BATTLE_WORLD_NINE

/datum/battle_arcade_gear/tier_9/weapon
name = "Mjolnir"
slot = WEAPON_SLOT
bonus_modifier = 5

/datum/battle_arcade_gear/tier_8/armor
name = "Ethereal Armor"
/datum/battle_arcade_gear/tier_9/armor
name = "Void Armor"
slot = ARMOR_SLOT
bonus_modifier = 5

0 comments on commit 3e38964

Please sign in to comment.