mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
[MIRROR] Basic Mob Spiders I: Ability refactor [MDB IGNORE] (#19200)
* Basic Mob Spiders I: Ability refactor * Update tgstation.dme * Update tgstation.dme * Update tgstation.dme * Update tgstation.dme * Update tgstation.dme * Update tgstation.dme --------- Co-authored-by: Jacquerel <hnevard@gmail.com> Co-authored-by: KathrinBailey <53862927+KathrinBailey@users.noreply.github.com> Co-authored-by: KathrinBailey <kat892@outlook.com>
This commit is contained in:
co-authored by
Jacquerel
KathrinBailey
KathrinBailey
parent
5f1fe0a0a9
commit
bb9b68a88d
@@ -17,7 +17,7 @@
|
||||
/// Visual indicators upon the character of the owner of this mutation
|
||||
var/static/list/visual_indicators = list()
|
||||
/// The path of action we grant to our user on mutation gain
|
||||
var/datum/action/cooldown/spell/power_path
|
||||
var/datum/action/cooldown/power_path
|
||||
/// Which mutation layer to use
|
||||
var/layer_used = MUTATIONS_LAYER
|
||||
/// To restrict mutation to only certain species
|
||||
@@ -180,7 +180,7 @@
|
||||
/datum/mutation/human/proc/modify()
|
||||
if(modified || !power_path || !owner)
|
||||
return
|
||||
var/datum/action/cooldown/spell/modified_power = locate(power_path) in owner.actions
|
||||
var/datum/action/cooldown/modified_power = locate(power_path) in owner.actions
|
||||
if(!modified_power)
|
||||
CRASH("Genetic mutation [type] called modify(), but could not find a action to modify!")
|
||||
modified_power.cooldown_time *= GET_MUTATION_ENERGY(src) // Doesn't do anything for mutations with energy_coeff unset
|
||||
@@ -217,7 +217,7 @@
|
||||
if(!ispath(power_path) || !owner)
|
||||
return FALSE
|
||||
|
||||
var/datum/action/cooldown/spell/new_power = new power_path(src)
|
||||
var/datum/action/cooldown/new_power = new power_path(src)
|
||||
new_power.background_icon_state = "bg_tech_blue"
|
||||
new_power.base_background_icon_state = new_power.background_icon_state
|
||||
new_power.active_background_icon_state = "[new_power.base_background_icon_state]_active"
|
||||
|
||||
@@ -5,20 +5,20 @@
|
||||
quality = POSITIVE
|
||||
text_gain_indication = "<span class='notice'>Your skin feels webby.</span>"
|
||||
instability = 15
|
||||
power_path = /datum/action/cooldown/spell/lay_genetic_web
|
||||
power_path = /datum/action/cooldown/lay_web/genetic
|
||||
energy_coeff = 1
|
||||
|
||||
/datum/mutation/human/webbing/modify()
|
||||
. = ..()
|
||||
var/datum/action/cooldown/spell/lay_genetic_web/to_modify =.
|
||||
var/datum/action/cooldown/lay_web/genetic/to_modify = .
|
||||
|
||||
if(!istype(to_modify)) // null or invalid
|
||||
return
|
||||
|
||||
if(GET_MUTATION_ENERGY(src) == 1) //energetic chromosome outputs a value less than 1 when present, 1 by default
|
||||
if(GET_MUTATION_ENERGY(src) == 1) // Energetic chromosome outputs a value less than 1 when present, 1 by default
|
||||
to_modify.webbing_time = initial(to_modify.webbing_time)
|
||||
return
|
||||
to_modify.webbing_time = 2 SECONDS
|
||||
to_modify.webbing_time = 2 SECONDS // Spin webs faster but not more often
|
||||
|
||||
/datum/mutation/human/webbing/on_acquiring(mob/living/carbon/human/owner)
|
||||
if(..())
|
||||
@@ -29,37 +29,3 @@
|
||||
if(..())
|
||||
return
|
||||
REMOVE_TRAIT(owner, TRAIT_WEB_WEAVER, GENETIC_MUTATION)
|
||||
|
||||
// In the future this could be unified with the spider's web action
|
||||
/datum/action/cooldown/spell/lay_genetic_web
|
||||
name = "Lay Web"
|
||||
desc = "Drops a web. Only you will be able to traverse your web easily, making it pretty good for keeping you safe."
|
||||
button_icon = 'icons/mob/actions/actions_genetic.dmi'
|
||||
button_icon_state = "lay_web"
|
||||
|
||||
cooldown_time = 4 SECONDS //the same time to lay a web
|
||||
spell_requirements = NONE
|
||||
|
||||
/// How long it takes to lay a web
|
||||
var/webbing_time = 4 SECONDS
|
||||
/// The path of web that we create
|
||||
var/web_path = /obj/structure/spider/stickyweb/genetic
|
||||
|
||||
/datum/action/cooldown/spell/lay_genetic_web/cast(atom/cast_on)
|
||||
var/turf/web_spot = cast_on.loc
|
||||
if(!isturf(web_spot) || (locate(web_path) in web_spot))
|
||||
to_chat(cast_on, span_warning("You can't lay webs here!"))
|
||||
reset_spell_cooldown()
|
||||
return FALSE
|
||||
|
||||
cast_on.visible_message(
|
||||
span_notice("[cast_on] begins to secrete a sticky substance."),
|
||||
span_notice("You begin to lay a web."),
|
||||
)
|
||||
|
||||
if(!do_after(cast_on, webbing_time, target = web_spot))
|
||||
to_chat(cast_on, span_warning("Your web spinning was interrupted!"))
|
||||
return
|
||||
|
||||
new web_path(web_spot, cast_on)
|
||||
return ..()
|
||||
|
||||
Reference in New Issue
Block a user