Files
Bubberstation/code/modules/research/techweb/_techweb_node.dm
SkyratBot 6f7494fd09 [MIRROR] New Traitor mech: Justice. (#28628)
* New Traitor mech: Justice. (#84097)

## About The Pull Request

Adds new mech that can be created from emaged fabricator. To craft this
mech you need:
1. Emag Fabricator to recive Justice disgine(done this, fabricator will
emit a text and sound signal that can reveal you).
2. You need to craft it like any other mech but you also need 8
telecrystals to finish constraction.
3. To board a mech you need syndicate access (traitor can get it by
purchasing an agent card).
About Mech:
Video:
https://youtu.be/QwJfO_lbLK0
Text:
Health 200
Damage 60
Only melee attacks(can't attach range weapons(can't attach anything in
his arms at all))
Block chanse 60
Speed - in safty mode 2.5 in combat mode 4.5
Attack effects:
In addition to damage, it has a 50 percent chance of cutting off an arm
or leg (does not put you to sleep or give a knockdown
effect when hit like regular combat mechs do).
If a target in crit or stun makes a finishing attack instead of a
regular attack, the mech says an epic phrase and after a second cuts off
the target's head by dashing through the target.

Special actions(can't be used if mech in safty mode):

Invisability - Makes the mech invisible for 20 seconds. If the mech is
pushed or collides with someone or if the pilot presses the invisibility
button again, the mech will no longer be invisible and will go into a 5
second cooldown (the same will happen after 20 seconds). If you attack
in invisibility, then instead of a normal attack the mech will make an
AoE 3x3 attack 1 second after pressing (the attack will be accompanied
by a sound and visual effect and for a second the mech will not be able
to move, which gives enemies time to run away from the attack). Upon
completion AoE attack, everyone( except peoples in crit and in stunned
condition) in a 3x3 radius will receive 35 damage and a 25 chance of
having one of their limbs cut off.

Charge Attack - Mech makes a dash towards the cursor at a distance of up
to 7 cells, breaking all obstacles in its path. If the obstacle is a
living person (and he is not in crit and is not stunned) then he will
receive 35 damage and a 25 chance of cutting off a limb. Cooldown 5
Seconds.
P.S.
Also added emag_act on fabricator so you can put any new secret traitor
mechs on it.
Also made the sounds of mech melee attacks to vars so that it would be
more convenient to change them.

Also fix a runtime error where if you set something in the mech's
max_equip_by_category to 0, the mech UI panel doesn't load.

## Why It's Good For The Game

Adds a traitor mech with fun and interesting mechanics. This is a new
mech with new unique abilities that turns the battle with you into a
boss fight.

## Changelog

🆑
add: New traitor mech: Justice. Emag fabricator to get it.
/🆑

---------

Co-authored-by: Jacquerel <hnevard@ gmail.com>

* New Traitor mech: Justice.

---------

Co-authored-by: Xackii <120736708+Xackii@users.noreply.github.com>
Co-authored-by: Jacquerel <hnevard@ gmail.com>
2024-07-05 10:38:46 +05:30

104 lines
3.7 KiB
Plaintext

/**
* # Techweb Node
*
* A datum representing a researchable node in the techweb.
*
* Techweb nodes are GLOBAL, there should only be one instance of them in the game. Persistant
* changes should never be made to them in-game. USE SSRESEARCH PROCS TO OBTAIN REFERENCES.
* DO NOT REFERENCE OUTSIDE OF SSRESEARCH OR YOU WILL FUCK UP GC.
*/
/datum/techweb_node
/// Internal ID of the node
var/id
/// The name of the node as it is shown on UIs
var/display_name = "Errored Node"
/// A description of the node to show on UIs
var/description = "Why are you seeing this?"
/// Whether it starts off hidden
var/hidden = FALSE
/// If the tech can be randomly generated by BEPIS tech as a reward. Meant to be fully given in tech disks, not researched
var/experimental = FALSE
/// Whether it's available without any research
var/starting_node = FALSE
var/list/prereq_ids = list()
var/list/design_ids = list()
/// CALCULATED FROM OTHER NODE'S PREREQUISITIES. Associated list id = TRUE
var/list/unlock_ids = list()
/// List of items you need to deconstruct to unlock this node.
var/list/required_items_to_unlock = list()
/// Boosting this will autounlock this node
var/autounlock_by_boost = TRUE
/// The points cost to research the node, type = amount
var/list/research_costs = list()
/// The category of the node
var/category = "Misc"
/// The list of experiments required to research the node
var/list/required_experiments = list()
/// If completed, these experiments give a specific point amount discount to the node.area
var/list/discount_experiments = list()
/// When this node is completed, allows these experiments to be performed.
var/list/experiments_to_unlock = list()
/// Whether or not this node should show on the wiki
var/show_on_wiki = TRUE
/// Hidden Mech nodes unlocked when mech fabricator emaged.
var/illegal_mech_node = FALSE
/datum/techweb_node/error_node
id = "ERROR"
display_name = "ERROR"
description = "This usually means something in the database has corrupted. If it doesn't go away automatically, inform Central Command for their techs to fix it ASAP(tm)"
show_on_wiki = FALSE
/datum/techweb_node/proc/Initialize()
//Make lists associative for lookup
for(var/id in prereq_ids)
prereq_ids[id] = TRUE
for(var/id in design_ids)
design_ids[id] = TRUE
for(var/id in unlock_ids)
unlock_ids[id] = TRUE
/datum/techweb_node/Destroy()
SSresearch.techweb_nodes -= id
return ..()
/datum/techweb_node/proc/on_design_deletion(datum/design/D)
prune_design_id(D.id)
/datum/techweb_node/proc/on_node_deletion(datum/techweb_node/TN)
prune_node_id(TN.id)
/datum/techweb_node/proc/prune_design_id(design_id)
design_ids -= design_id
/datum/techweb_node/proc/prune_node_id(node_id)
prereq_ids -= node_id
unlock_ids -= node_id
/datum/techweb_node/proc/get_price(datum/techweb/host)
if(!host)
return research_costs
var/list/actual_costs = research_costs.Copy()
for(var/cost_type in actual_costs)
for(var/experiment_type in discount_experiments)
if(host.completed_experiments[experiment_type]) //do we have this discount_experiment unlocked?
actual_costs[cost_type] -= discount_experiments[experiment_type]
if(host.boosted_nodes[id]) // Boosts should be subservient to experiments. Discount from boosts are capped when costs fall below 250.
var/list/boostlist = host.boosted_nodes[id]
for(var/booster in boostlist)
if(actual_costs[booster])
var/delta = max(0, actual_costs[booster] - 250)
actual_costs[booster] -= min(boostlist[booster], delta)
return actual_costs
/datum/techweb_node/proc/price_display(datum/techweb/TN)
return techweb_point_display_generic(get_price(TN))
///Proc called when the Station (Science techweb specific) researches a node.
/datum/techweb_node/proc/on_station_research()
SHOULD_CALL_PARENT(FALSE)