Skip to content

Commit

Permalink
Fixes the runtime of civilians spawning with a tier 0 skill book + op…
Browse files Browse the repository at this point in the history
…timizations and cleanup (#2606)

* initial commit

* small oversight (this system used to have 7 lists)

* adds these ---> ()

* Recodes and fixes smite

* cleans up unnecessary comments, moves vars a bit

* linter fix + renaming some single-letter vars

* raaaaaah, one more
  • Loading branch information
Gboster-0 authored Dec 16, 2024
1 parent 7117e1c commit 1b70b58
Show file tree
Hide file tree
Showing 11 changed files with 173 additions and 246 deletions.
11 changes: 6 additions & 5 deletions code/game/objects/items/fixerskills/fishing/_fishing.dm
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
/datum/action/cooldown/fishing
icon_icon = 'icons/hud/screen_fishing.dmi'
button_icon_state = "sacredword"
name = "Sacred Word"
cooldown_time = 300
button_icon_state = "sacredword"
icon_icon = 'icons/hud/screen_fishing.dmi'
cooldown_time = 30 SECONDS
var/devotion_cost = 0

/datum/action/cooldown/fishing/Trigger()
if(!..())
. = ..()
if(!.)
return FALSE

var/mob/living/carbon/human/H = owner
var/required_devotion = devotion_cost

if(H.god_aligned == FISHGOD_SATURN)
required_devotion -= 1 //Get one less cost on these spells
required_devotion-- //Get one less cost on these spells

if(H.devotion < required_devotion)
to_chat(H, span_warning("You do not have enough devotion for this spell!"))
Expand Down
97 changes: 28 additions & 69 deletions code/game/objects/items/fixerskills/fishing/level1/arcane.dm
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
//Scry
/obj/item/book/granter/action/skill/scry
granted_action = /datum/action/cooldown/fishing/scry
actionname = "Scry"
name = "Level 1 Skill: Scry"
actionname = "Scry"
granted_action = /datum/action/cooldown/fishing/scry
level = 1
custom_premium_price = 600

/datum/action/cooldown/fishing/scry
button_icon_state = "scry"
name = "Scry"
cooldown_time = 300
button_icon_state = "scry"
cooldown_time = 30 SECONDS
devotion_cost = 1

/datum/action/cooldown/fishing/scry/FishEffect(mob/living/user)
Expand All @@ -24,97 +23,57 @@
if(4)
to_chat(user, span_notice("The moon is Full."))

if(CheckPlanetAligned(FISHGOD_MERCURY))
to_chat(user, span_notice("Mercury is in alignment with earth."))
if(CheckPlanetAligned(FISHGOD_VENUS))
to_chat(user, span_notice("Venus is in alignment with earth."))
if(CheckPlanetAligned(FISHGOD_MARS))
to_chat(user, span_notice("Mars is in alignment with earth."))
if(CheckPlanetAligned(FISHGOD_JUPITER))
to_chat(user, span_notice("Jupiter is in alignment with earth."))
if(CheckPlanetAligned(FISHGOD_SATURN))
to_chat(user, span_notice("Saturn is in alignment with earth."))
if(CheckPlanetAligned(FISHGOD_URANUS))
to_chat(user, span_notice("Uranus is in alignment with earth."))
if(CheckPlanetAligned(FISHGOD_NEPTUNE))
to_chat(user, span_notice("Neptune is in alignment with earth."))

for(var/datum/planet/planet as anything in SSfishing.planets)
if(planet.phase == 1)
to_chat(user, span_notice("[planet.name] is in alignment with earth."))


//Sacred Word
/obj/item/book/granter/action/skill/sacredword
granted_action = /datum/action/cooldown/fishing/sacredword
actionname = "Sacred Word"
name = "Level 1 Skill: Sacred Word"
actionname = "Sacred Word"
granted_action = /datum/action/cooldown/fishing/sacredword
level = 1
custom_premium_price = 600

/datum/action/cooldown/fishing/sacredword
button_icon_state = "sacredword"
name = "Sacred Word"
cooldown_time = 6000
button_icon_state = "sacredword"
cooldown_time = 10 MINUTES
devotion_cost = 0

/datum/action/cooldown/fishing/sacredword/FishEffect(mob/living/user)
switch(user.god_aligned)
if(FISHGOD_MERCURY)
if(CheckPlanetAligned(FISHGOD_MERCURY))
user.devotion+=4
to_chat(user, span_notice("Lir hears your words."))

if(FISHGOD_VENUS)
if(CheckPlanetAligned(FISHGOD_VENUS))
user.devotion+=6
to_chat(user, span_notice("Tefnut hears your words."))

if(FISHGOD_MARS)
if(CheckPlanetAligned(FISHGOD_MARS))
user.devotion+=8
to_chat(user, span_notice("Arnapkapfaaluk hears your words."))

if(FISHGOD_JUPITER)
if(CheckPlanetAligned(FISHGOD_JUPITER))
user.devotion+=10
to_chat(user, span_notice("Susanoo hears your words."))
for(var/datum/planet/planet as anything in SSfishing.planets)
if(user.god_aligned != planet.god)
continue

if(FISHGOD_SATURN)
if(CheckPlanetAligned(FISHGOD_SATURN))
user.devotion+=12
to_chat(user, span_notice("Kukulkan hears your words."))

if(FISHGOD_URANUS)
if(CheckPlanetAligned(FISHGOD_URANUS))
user.devotion+=14
to_chat(user, span_notice("Abena Mansa hears your words."))

if(FISHGOD_NEPTUNE)
if(CheckPlanetAligned(FISHGOD_NEPTUNE))
user.devotion+=16
to_chat(user, span_notice("Glaucus hears your words."))
else
if(planet.phase != 1)
to_chat(user, span_notice("Your planet is misaligned. Your prayer goes unanswered."))
return

user.devotion += (planet.orbit_time * 2)
to_chat(user, span_notice("[user.god_aligned] hears your words."))
return

to_chat(user, span_danger("... but silence is the only listener.")) // Your planet is done broke

//Commune
/obj/item/book/granter/action/skill/commune
granted_action = /datum/action/cooldown/fishing/commune
actionname = "Commune"
name = "Level 1 Skill: Commune"
actionname = "Commune"
granted_action = /datum/action/cooldown/fishing/commune
level = 1
custom_premium_price = 600

/datum/action/cooldown/fishing/commune
button_icon_state = "commune"
name = "Commune"
cooldown_time = 100
button_icon_state = "commune"
cooldown_time = 10 SECONDS
devotion_cost = 1

/datum/action/cooldown/fishing/commune/FishEffect(mob/living/user)
if(user.god_aligned == FISHGOD_NONE) //Athiests can't commune because they don't have a soul
if(user.god_aligned == FISHGOD_NONE) // Athiests can't commune because they don't have a soul
to_chat(user, span_userdanger("YOU HAVE NO GOD."))

var/input = stripped_input(user,"What do you want to send to others that follow your god?", ,"Commune")
message_admins("<span class='notice'>A fisherman ([user.ckey]) has used commune with the following message: [input].</span>")
var/input = stripped_input(user, "What do you want to send to others that follow your god?", "Fish communion", "Commune")
message_admins("A fisherman ([user.ckey]) has used commune with the following message: [input].")
for(var/mob/living/M in GLOB.player_list)
if(M.god_aligned == user.god_aligned)
to_chat(M, span_userdanger("You have a message for you: [input]"))
20 changes: 10 additions & 10 deletions code/game/objects/items/fixerskills/fishing/level1/healing.dm
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@

//Prayer
/obj/item/book/granter/action/skill/prayer
granted_action = /datum/action/cooldown/fishing/prayer
actionname = "Lunar Prayer"
name = "Level 1 Skill: Lunar Prayer"
actionname = "Lunar Prayer"
granted_action = /datum/action/cooldown/fishing/prayer
level = 1
custom_premium_price = 600

/datum/action/cooldown/fishing/prayer
button_icon_state = "lunar"
name = "Lunar Prayer"
cooldown_time = 300
button_icon_state = "lunar"
cooldown_time = 30 SECONDS
devotion_cost = 3

/datum/action/cooldown/fishing/prayer/FishEffect(mob/living/user)
var/healamount = 5
healamount*=SSfishing.moonphase
healamount *= SSfishing.moonphase
for(var/mob/living/carbon/human/H in view(2, get_turf(src)))
if(H.stat >= HARD_CRIT)
continue
Expand All @@ -26,21 +26,21 @@

//God's love
/obj/item/book/granter/action/skill/love
granted_action = /datum/action/cooldown/fishing/love
actionname = "God's Love"
name = "Level 1 Skill: The God's Love"
actionname = "God's Love"
granted_action = /datum/action/cooldown/fishing/love
level = 1
custom_premium_price = 600

/datum/action/cooldown/fishing/love
button_icon_state = "love"
name = "God's Love"
cooldown_time = 300
button_icon_state = "love"
cooldown_time = 30 SECONDS
devotion_cost = 3
var/healamount = 1

/datum/action/cooldown/fishing/love/FishEffect(mob/living/user)
healamount+=1
healamount++
var/givehealing = TOUGHER_TIMES_SPECIFIC(healamount,0.02)
for(var/mob/living/carbon/human/H in view(2, get_turf(src)))
if(H.stat >= HARD_CRIT)
Expand Down
38 changes: 16 additions & 22 deletions code/game/objects/items/fixerskills/fishing/level1/joke.dm
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
//Detect Fish
//A useless skill, made to be funny
/// A useless* skill, made to be funny
/obj/item/book/granter/action/skill/detect
granted_action = /datum/action/cooldown/fishing/detect
actionname = "Detect Fish"
name = "Level 1 Skill: Detect Fish"
actionname = "Detect Fish"
granted_action = /datum/action/cooldown/fishing/detect
level = 1
custom_premium_price = 600

/datum/action/cooldown/fishing/detect
button_icon_state = "detect"
name = "Detect Fish"
cooldown_time = 300
button_icon_state = "detect"
cooldown_time = 30 SECONDS
devotion_cost = 1

/datum/action/cooldown/fishing/detect/FishEffect(mob/living/user)
Expand All @@ -24,38 +23,35 @@
to_chat(user, span_notice("There's no fish nearby."))


//Fish Lockpick
//Opens any fish-shaped lock
/// Opens any fish-shaped lock
/obj/item/book/granter/action/skill/fishlockpick
granted_action = /datum/action/cooldown/fishing/fishlockpick
actionname = "Fish Lockpick"
name = "Level 1 Skill: Fish Lockpick"
actionname = "Fish Lockpick"
granted_action = /datum/action/cooldown/fishing/fishlockpick
level = 1
custom_premium_price = 600

/datum/action/cooldown/fishing/fishlockpick
button_icon_state = "fishlockpick"
name = "Fish Lockpick"
cooldown_time = 300
button_icon_state = "fishlockpick"
cooldown_time = 30 SECONDS
devotion_cost = 1

/datum/action/cooldown/fishing/fishlockpick/FishEffect(mob/living/user)
to_chat(user, span_notice("All nearby fish-shaped locks have been opened."))


//Fish Telepathy
//Commune with the fish. Basically fishing
/// Commune with the fish. Basically fishing
/obj/item/book/granter/action/skill/fishtelepathy
granted_action = /datum/action/cooldown/fishing/fishtelepathy
actionname = "Fish Telepathy"
name = "Level 1 Skill: Fish Telepathy"
actionname = "Fish Telepathy"
granted_action = /datum/action/cooldown/fishing/fishtelepathy
level = 1
custom_premium_price = 600

/datum/action/cooldown/fishing/fishtelepathy
button_icon_state = "fishtelepathy"
name = "Fish Telepathy"
cooldown_time = 400
button_icon_state = "fishtelepathy"
cooldown_time = 40 SECONDS
devotion_cost = 1

/datum/action/cooldown/fishing/fishtelepathy/FishEffect(mob/living/user)
Expand All @@ -68,9 +64,7 @@
return
to_chat(user, span_notice("There's no fish nearby."))


/datum/action/cooldown/fishing/fishtelepathy/proc/Recall(mob/living/carbon/human/user)
to_chat(user, span_notice("The fish have crucial news for you:"))
to_chat(user, span_notice("Glub."))
user.devotion+=2

user.devotion += 2
32 changes: 14 additions & 18 deletions code/game/objects/items/fixerskills/fishing/level1/motion.dm
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
//Planetary Momentum
/obj/item/book/granter/action/skill/planet
granted_action = /datum/action/cooldown/fishing/planet
actionname = "Planet"
name = "Level 1 Skill: Planet"
actionname = "Planet"
granted_action = /datum/action/cooldown/fishing/planet
level = 1
custom_premium_price = 600

/datum/action/cooldown/fishing/planet
button_icon_state = "planet"
name = "Planet"
cooldown_time = 6000
button_icon_state = "planet"
cooldown_time = 10 MINUTES
devotion_cost = 2

/datum/action/cooldown/fishing/planet/FishEffect(mob/living/user)
Expand All @@ -23,39 +22,36 @@
to_chat(user, span_notice("You shift the movement of your aligned planet by 1."))
break

//Lunar Motion
/obj/item/book/granter/action/skill/moonmove
granted_action = /datum/action/cooldown/fishing/moonmove
actionname = "Lunar Motion"
name = "Level 1 Skill: Lunar Motion"
actionname = "Lunar Motion"
granted_action = /datum/action/cooldown/fishing/moonmove
level = 1
custom_premium_price = 600

/datum/action/cooldown/fishing/moonmove
button_icon_state = "moonmove"
name = "Lunar Motion"
cooldown_time = 6000
button_icon_state = "moonmove"
cooldown_time = 10 MINUTES
devotion_cost = 3

/datum/action/cooldown/fishing/moonmove/FishEffect(mob/living/user)
to_chat(user, span_notice("You shift the moon forwards by one phase."))
SSfishing.moonphase+=1 //Moon Phases will affect the power of Moon-based mods.
if(SSfishing.moonphase == 5) //there's only 4
SSfishing.moonphase++
if(SSfishing.moonphase == 5) // there's only 4
SSfishing.moonphase = 1


//Targeted Planet
/obj/item/book/granter/action/skill/planet2
granted_action = /datum/action/cooldown/fishing/planet2
actionname = "Planet II"
name = "Level 1 Skill: Plane II"
actionname = "Planet II"
granted_action = /datum/action/cooldown/fishing/planet2
level = 1
custom_premium_price = 600

/datum/action/cooldown/fishing/planet2
button_icon_state = "planet2"
name = "Planet II"
cooldown_time = 6000
button_icon_state = "planet2"
cooldown_time = 10 MINUTES
devotion_cost = 4

/datum/action/cooldown/fishing/planet2/FishEffect(mob/living/user)
Expand Down
Loading

0 comments on commit 1b70b58

Please sign in to comment.