mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 15:47:15 +01:00
Merge pull request #12904 from Incoming5643/action_action_action_action_action
Adds action buttons for slimes
This commit is contained in:
@@ -262,7 +262,7 @@ datum/species/human/spec_death(gibbed, mob/living/carbon/human/H)
|
||||
/datum/action/innate/split_body
|
||||
name = "Split Body"
|
||||
check_flags = AB_CHECK_ALIVE
|
||||
button_icon_state = "split"
|
||||
button_icon_state = "slimesplit"
|
||||
background_icon_state = "bg_alien"
|
||||
|
||||
/datum/action/innate/split_body/CheckRemoval()
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
M.regenerate_icons()
|
||||
is_adult = 0
|
||||
maxHealth = 150
|
||||
var/datum/action/innate/slime/evolve/E = new
|
||||
E.Grant(src)
|
||||
revive()
|
||||
regenerate_icons()
|
||||
number = rand(1, 1000)
|
||||
@@ -39,4 +41,4 @@
|
||||
for(var/obj/machinery/computer/camera_advanced/xenobio/X in machines)
|
||||
if(src in X.stored_slimes)
|
||||
X.stored_slimes -= src
|
||||
return ..()
|
||||
return ..()
|
||||
|
||||
@@ -222,11 +222,11 @@
|
||||
if(prob(75))
|
||||
adjustBruteLoss(rand(0,5))
|
||||
|
||||
else if (nutrition >= get_grow_nutrition() && amount_grown < 10)
|
||||
else if (nutrition >= get_grow_nutrition() && amount_grown < SLIME_EVOLUTION_THRESHOLD)
|
||||
nutrition -= 20
|
||||
amount_grown++
|
||||
|
||||
if(amount_grown >= 10 && !buckled && !Target && !ckey)
|
||||
if(amount_grown >= SLIME_EVOLUTION_THRESHOLD && !buckled && !Target && !ckey)
|
||||
if(is_adult)
|
||||
Reproduce()
|
||||
else
|
||||
|
||||
@@ -1,3 +1,36 @@
|
||||
#define SIZE_DOESNT_MATTER -1
|
||||
#define BABIES_ONLY 0
|
||||
#define ADULTS_ONLY 1
|
||||
|
||||
#define NO_GROWTH_NEEDED 0
|
||||
#define GROWTH_NEEDED 1
|
||||
|
||||
/datum/action/innate/slime
|
||||
check_flags = AB_CHECK_ALIVE
|
||||
background_icon_state = "bg_alien"
|
||||
var/adult_action = SIZE_DOESNT_MATTER
|
||||
var/needs_growth = NO_GROWTH_NEEDED
|
||||
|
||||
/datum/action/innate/slime/CheckRemoval()
|
||||
if(!isslime(owner))
|
||||
return 1
|
||||
var/mob/living/simple_animal/slime/S = owner
|
||||
if(adult_action != SIZE_DOESNT_MATTER)
|
||||
if(adult_action == ADULTS_ONLY && !S.is_adult)
|
||||
return 1
|
||||
else if(adult_action == BABIES_ONLY && S.is_adult)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/action/innate/slime/IsAvailable()
|
||||
if(..())
|
||||
var/mob/living/simple_animal/slime/S = owner
|
||||
if(needs_growth == GROWTH_NEEDED)
|
||||
if(S.amount_grown >= SLIME_EVOLUTION_THRESHOLD)
|
||||
return 1
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/mob/living/simple_animal/slime/verb/Feed()
|
||||
set category = "Slime"
|
||||
set desc = "This will let you feed on any valid creature in the surrounding area. This should also be used to halt the feeding process."
|
||||
@@ -16,6 +49,15 @@
|
||||
Feedon(M)
|
||||
return 1
|
||||
|
||||
/datum/action/innate/slime/feed
|
||||
name = "Feed"
|
||||
button_icon_state = "slimeeat"
|
||||
|
||||
|
||||
/datum/action/innate/slime/feed/Activate()
|
||||
var/mob/living/simple_animal/slime/S = owner
|
||||
S.Feed()
|
||||
|
||||
/mob/living/simple_animal/slime/proc/CanFeedon(mob/living/M)
|
||||
if(!Adjacent(M))
|
||||
return 0
|
||||
@@ -68,7 +110,7 @@
|
||||
src << "<i>I must be conscious to do this...</i>"
|
||||
return
|
||||
if(!is_adult)
|
||||
if(amount_grown >= 10)
|
||||
if(amount_grown >= SLIME_EVOLUTION_THRESHOLD)
|
||||
is_adult = 1
|
||||
maxHealth = 200
|
||||
amount_grown = 0
|
||||
@@ -79,6 +121,19 @@
|
||||
else
|
||||
src << "<i>I have already evolved...</i>"
|
||||
|
||||
/datum/action/innate/slime/evolve
|
||||
name = "Evolve"
|
||||
button_icon_state = "slimegrow"
|
||||
adult_action = BABIES_ONLY
|
||||
needs_growth = GROWTH_NEEDED
|
||||
|
||||
/datum/action/innate/slime/evolve/Activate()
|
||||
var/mob/living/simple_animal/slime/S = owner
|
||||
S.Evolve()
|
||||
if(S.is_adult)
|
||||
var/datum/action/innate/slime/reproduce/A = new
|
||||
A.Grant(S)
|
||||
|
||||
/mob/living/simple_animal/slime/verb/Reproduce()
|
||||
set category = "Slime"
|
||||
set desc = "This will make you split into four Slimes."
|
||||
@@ -88,7 +143,7 @@
|
||||
return
|
||||
|
||||
if(is_adult)
|
||||
if(amount_grown >= 10)
|
||||
if(amount_grown >= SLIME_EVOLUTION_THRESHOLD)
|
||||
if(stat)
|
||||
src << "<i>I must be conscious to do this...</i>"
|
||||
return
|
||||
@@ -123,4 +178,14 @@
|
||||
else
|
||||
src << "<i>I am not ready to reproduce yet...</i>"
|
||||
else
|
||||
src << "<i>I am not old enough to reproduce yet...</i>"
|
||||
src << "<i>I am not old enough to reproduce yet...</i>"
|
||||
|
||||
/datum/action/innate/slime/reproduce
|
||||
name = "Reproduce"
|
||||
button_icon_state = "slimesplit"
|
||||
adult_action = ADULTS_ONLY
|
||||
needs_growth = GROWTH_NEEDED
|
||||
|
||||
/datum/action/innate/slime/reproduce/Activate()
|
||||
var/mob/living/simple_animal/slime/S = owner
|
||||
S.Reproduce()
|
||||
|
||||
@@ -70,9 +70,16 @@
|
||||
var/list/slime_mutation[4]
|
||||
|
||||
/mob/living/simple_animal/slime/New()
|
||||
var/datum/action/innate/slime/feed/F = new
|
||||
F.Grant(src)
|
||||
if(is_adult)
|
||||
var/datum/action/innate/slime/reproduce/R = new
|
||||
R.Grant(src)
|
||||
health = 200
|
||||
maxHealth = 200
|
||||
else
|
||||
var/datum/action/innate/slime/evolve/E = new
|
||||
E.Grant(src)
|
||||
create_reagents(100)
|
||||
spawn (0)
|
||||
number = rand(1, 1000)
|
||||
@@ -149,7 +156,7 @@
|
||||
|
||||
if(!docile)
|
||||
stat(null, "Nutrition: [nutrition]/[get_max_nutrition()]")
|
||||
if(amount_grown >= 10)
|
||||
if(amount_grown >= SLIME_EVOLUTION_THRESHOLD)
|
||||
if(is_adult)
|
||||
stat(null, "You can reproduce!")
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user