-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into easter-is-reaaaal…
…llllll
- Loading branch information
Showing
65 changed files
with
3,752 additions
and
63 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#define ACTIONSPEED_ID_BORER "borer" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+357 Bytes
code/modules/unit_tests/screenshots/screenshot_antag_icons_corticalborer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
author: "MomoBerri" | ||
delete-after: True | ||
changes: | ||
- qol: "several updates to the labor camp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
author: "Jake Park, Zonespace, Gboster" | ||
delete-after: True | ||
changes: | ||
- rscadd: "Added a new antagonist: The cortical borer, capable of manipulating humans with the sole goal of making more of itself" |
79 changes: 79 additions & 0 deletions
79
monkestation/code/modules/antagonists/borers/code/abilities/_ability.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// Parent of all borer actions | ||
/datum/action/cooldown/borer | ||
button_icon = 'monkestation/code/modules/antagonists/borers/icons/actions.dmi' | ||
cooldown_time = 0 | ||
/// Text used to explain the ability more closelly in the antagonist TGUI panel | ||
var/ability_explanation = "" | ||
|
||
/// How many chemicals this costs | ||
var/chemical_cost = 0 | ||
/// How many chem evo points are needed to use this ability | ||
var/chemical_evo_points = 0 | ||
/// How many stat evo points are needed to use this ability | ||
var/stat_evo_points = 0 | ||
|
||
/// Does this ability need a human host to be triggered? | ||
var/requires_host = FALSE | ||
/// Can this ability function within a living host? | ||
var/needs_living_host = FALSE | ||
/// Can this ability function within a dead host? | ||
var/needs_dead_host = FALSE | ||
/// Does this ability stop working when the host has sugar? | ||
var/sugar_restricted = FALSE | ||
|
||
/datum/action/cooldown/borer/New(Target, original) | ||
. = ..() | ||
var/compiled_string = "" | ||
if(chemical_cost) | ||
compiled_string += "([chemical_cost] chemical[chemical_cost == 1 ? "" : "s"])" | ||
if(stat_evo_points) | ||
compiled_string += " ([stat_evo_points] stat point[stat_evo_points == 1 ? "" : "s"])" | ||
if(chemical_evo_points) | ||
compiled_string += " ([chemical_evo_points] chemical point[chemical_evo_points == 1 ? "" : "s"])" | ||
name = "[initial(name)][compiled_string]" | ||
|
||
/datum/action/cooldown/borer/Trigger(trigger_flags, atom/target) | ||
. = ..() | ||
|
||
// Safety checks | ||
if(!iscorticalborer(owner)) | ||
to_chat(owner, span_warning("You must be a cortical borer to use this action!")) | ||
return FALSE | ||
var/mob/living/basic/cortical_borer/cortical_owner = owner | ||
|
||
// Status Requirements | ||
if(requires_host == TRUE && !cortical_owner.inside_human()) | ||
owner.balloon_alert(owner, "host required") | ||
return FALSE | ||
if(needs_living_host == TRUE && cortical_owner.human_host.stat == DEAD) | ||
owner.balloon_alert(owner, "Alive host required") | ||
return FALSE | ||
if(needs_dead_host == TRUE && cortical_owner.human_host.stat != DEAD) | ||
owner.balloon_alert(owner, "Dead host required") | ||
return FALSE | ||
if(sugar_restricted == TRUE && cortical_owner.host_sugar()) | ||
owner.balloon_alert(owner, "cannot function with sugar in host") | ||
return FALSE | ||
|
||
// Resource costs | ||
if(cortical_owner.chemical_storage < chemical_cost) | ||
cortical_owner.balloon_alert(cortical_owner, "need [chemical_cost] chemicals") | ||
return FALSE | ||
if(cortical_owner.chemical_evolution < chemical_evo_points) | ||
cortical_owner.balloon_alert(cortical_owner, "need [chemical_evo_points] chemical points") | ||
return FALSE | ||
if(cortical_owner.stat_evolution < stat_evo_points) | ||
cortical_owner.balloon_alert(cortical_owner, "need [stat_evo_points] stat points") | ||
return FALSE | ||
|
||
return . == FALSE ? FALSE : TRUE //. can be null, true, or false. There's a difference between null and false here | ||
|
||
/datum/asset/simple/borer_icons | ||
|
||
/datum/asset/simple/borer_icons/register() | ||
for(var/datum/action/cooldown/borer/ability as anything in subtypesof(/datum/action/cooldown/borer)) | ||
add_borer_icon(initial(ability.button_icon), initial(ability.button_icon_state)) | ||
return ..() | ||
|
||
/datum/asset/simple/borer_icons/proc/add_borer_icon(borer_icon, borer_icon_state) | ||
assets[SANITIZE_FILENAME("borer.[borer_icon_state].png")] = icon(borer_icon, borer_icon_state) |
101 changes: 101 additions & 0 deletions
101
monkestation/code/modules/antagonists/borers/code/abilities/chemical_injector.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
/// How many of OUR chemicals do we need to spend to inject 1 unit worth of chemicals being injected | ||
#define CHEMICALS_PER_UNIT 2 | ||
/// How long will the cooldown on injection be, per chemical injected? example: 10 chemicals injected, 5 second divisor = 2 seconds | ||
#define CHEMICAL_SECOND_DIVISOR (5 SECONDS) | ||
|
||
/** | ||
* Lets the borer inject chemicals from the "known_chemicals" list into the host | ||
*/ | ||
/datum/action/cooldown/borer/inject_chemical | ||
name = "Open Chemical Injector" | ||
button_icon_state = "chemical" | ||
requires_host = TRUE | ||
sugar_restricted = TRUE | ||
ability_explanation = "chemical" | ||
ability_explanation = "\ | ||
This ability allows us to inject chemicals into our host.\n\ | ||
Our internal chemicals can be converted to human-compatible chemicals at a ratio of 2:1\n\ | ||
" | ||
|
||
/datum/action/cooldown/borer/inject_chemical/Trigger(trigger_flags, atom/target) | ||
. = ..() | ||
if(!.) | ||
return FALSE | ||
ui_interact(owner) | ||
|
||
/datum/action/cooldown/borer/inject_chemical/ui_interact(mob/user, datum/tgui/ui) | ||
ui = SStgui.try_update_ui(user, src, ui) | ||
if(!ui) | ||
ui = new(user, src, "BorerChem", name) | ||
ui.open() | ||
|
||
/datum/action/cooldown/borer/inject_chemical/ui_data(mob/user) | ||
var/list/data = list() | ||
var/mob/living/basic/cortical_borer/cortical_owner = owner | ||
data["amount"] = cortical_owner.injection_rate_current | ||
data["energy"] = cortical_owner.chemical_storage / CHEMICALS_PER_UNIT | ||
data["maxEnergy"] = cortical_owner.max_chemical_storage / CHEMICALS_PER_UNIT | ||
data["borerTransferAmounts"] = cortical_owner.injection_rates_unlocked | ||
data["onCooldown"] = !COOLDOWN_FINISHED(cortical_owner, injection_cooldown) | ||
data["notEnoughChemicals"] = ((cortical_owner.injection_rate_current * CHEMICALS_PER_UNIT) > cortical_owner.chemical_storage) ? TRUE : FALSE | ||
|
||
var/chemicals[0] | ||
for(var/reagent in cortical_owner.known_chemicals) | ||
var/datum/reagent/temp = GLOB.chemical_reagents_list[reagent] | ||
if(temp) | ||
var/chemname = temp.name | ||
chemicals.Add(list(list("title" = chemname, "id" = ckey(temp.name)))) | ||
data["chemicals"] = chemicals | ||
|
||
return data | ||
|
||
/datum/action/cooldown/borer/inject_chemical/ui_act(action, params) | ||
. = ..() | ||
if(.) | ||
return | ||
var/mob/living/basic/cortical_borer/cortical_owner = owner | ||
switch(action) | ||
if("amount") | ||
var/target = text2num(params["target"]) | ||
if(target in cortical_owner.injection_rates) | ||
cortical_owner.injection_rate_current = target | ||
. = TRUE | ||
if("inject") | ||
if(!iscorticalborer(usr) || !COOLDOWN_FINISHED(cortical_owner, injection_cooldown)) | ||
return | ||
if(cortical_owner.host_sugar()) | ||
owner.balloon_alert(owner, "cannot function with sugar in host") | ||
return | ||
var/reagent_name = params["reagent"] | ||
var/reagent = GLOB.name2reagent[reagent_name] | ||
if(!(reagent in cortical_owner.known_chemicals)) | ||
return | ||
|
||
cortical_owner.reagent_holder.reagents.add_reagent(reagent, cortical_owner.injection_rate_current, added_purity = 1) | ||
cortical_owner.reagent_holder.reagents.trans_to(cortical_owner.human_host, cortical_owner.injection_rate_current, methods = INGEST) | ||
|
||
to_chat(cortical_owner.human_host, span_warning("You feel something cool inside of you and a dull ache in your head!")) | ||
cortical_owner.chemical_storage -= cortical_owner.injection_rate_current * CHEMICALS_PER_UNIT | ||
COOLDOWN_START(cortical_owner, injection_cooldown, (cortical_owner.injection_rate_current / CHEMICAL_SECOND_DIVISOR)) | ||
|
||
var/turf/human_turf = get_turf(cortical_owner.human_host) | ||
var/logging_text = "[key_name(cortical_owner)] injected [key_name(cortical_owner.human_host)] with [reagent_name] at [loc_name(human_turf)]" | ||
cortical_owner.log_message(logging_text, LOG_GAME) | ||
cortical_owner.human_host.log_message(logging_text, LOG_GAME) | ||
. = TRUE | ||
|
||
/datum/action/cooldown/borer/inject_chemical/ui_state(mob/user) | ||
return GLOB.always_state | ||
|
||
/datum/action/cooldown/borer/inject_chemical/ui_status(mob/user, datum/ui_state/state) | ||
if(!iscorticalborer(user)) | ||
return UI_CLOSE | ||
|
||
var/mob/living/basic/cortical_borer/borer = user | ||
|
||
if(!borer.human_host) | ||
return UI_CLOSE | ||
return ..() | ||
|
||
#undef CHEMICALS_PER_UNIT | ||
#undef CHEMICAL_SECOND_DIVISOR |
Oops, something went wrong.