Skip to content

Commit

Permalink
Converts hard-coded variables to datums in the fishing subsystem + mi…
Browse files Browse the repository at this point in the history
…nor fishing skills cleanup (#2535)

* Reworks tha subsystem

* prevents people from blowing up their own planets

* adds a message when you try to use supernova without a planet to detonate

* re-words 1 variable in fishing skills

* De-hardcodes shrine god choosing

* cleans up fish weapons

* Update fishing_shrine.dm

---------

Co-authored-by: Kirie Saito <[email protected]>
  • Loading branch information
Gboster-0 and Kitsunemitsu authored Nov 14, 2024
1 parent 547e691 commit 713fa3e
Show file tree
Hide file tree
Showing 10 changed files with 249 additions and 381 deletions.
18 changes: 9 additions & 9 deletions ModularTegustation/fishing/code/fish_market.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@

/obj/machinery/fish_market/ui_interact(mob/user) //Unsure if this can stand on its own as a structure, later on we may fiddle with that to break out of computer variables. -IP
. = ..()
check_city()
if(SSmaptype.maptype in SSmaptype.citymaps)
update_stock()
if(isliving(user))
playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE)
var/dat
Expand All @@ -52,7 +53,6 @@
var/datum/browser/popup = new(user, "FishingVendor", "FishingVendor", 440, 640)
popup.set_content(dat)
popup.open()
return

/obj/machinery/fish_market/Topic(href, href_list)
. = ..()
Expand Down Expand Up @@ -82,7 +82,7 @@
return TRUE

/obj/machinery/fish_market/attackby(obj/item/I, mob/user, params)
if(SSfishing.Uranus == 7)
if(SSfishing.IsAligned(/datum/planet/uranus))
to_chat(usr, span_notice("Uranus is aligned with earth. All fish points are increaed by 1.5x"))
if(istype(I, /obj/item/stack/fish_points))
var/obj/item/stack/fish_points/more_points = I
Expand Down Expand Up @@ -143,8 +143,8 @@
var/fish_weight = (F.weight - F.average_weight) / F.average_weight
var/fish_size = (F.size - F.average_size) / F.average_size
var/fish_worth_mod = 1 + fish_weight + fish_size
if(SSfishing.Uranus == 7)
fish_worth_mod*=1.5 //Bonus if uranus is aligned
if(SSfishing.IsAligned(/datum/planet/uranus))
fish_worth_mod *= 1.5 //Bonus if uranus is aligned

/*Fish Value based on rarity 2 is
the worth of fish that are basic.*/
Expand All @@ -159,9 +159,9 @@
return round(fish_worth * fish_worth_mod)


/obj/machinery/fish_market/proc/check_city()
if(SSmaptype.maptype in SSmaptype.citymaps)
order_list = list(
/obj/machinery/fish_market/proc/update_stock()
QDEL_LIST(order_list)
order_list = list(
new /datum/data/extraction_cargo("Discount Quality Suture ", /obj/item/stack/medical/suture/emergency, 50) = 1,
new /datum/data/extraction_cargo("Fishin Starting Pack ", /obj/item/storage/box/fishing, 200) = 1,
new /datum/data/extraction_cargo("Aquarium Rocks ", /obj/item/aquarium_prop/rocks, 250) = 1,
Expand Down Expand Up @@ -223,4 +223,4 @@
new /datum/data/extraction_cargo("Fishing Mod (R) ", /obj/item/workshop_mod/fishing, 200) = 1,
new /datum/data/extraction_cargo("Fishing Mod (W) ", /obj/item/workshop_mod/fishing/white, 200) = 1,
new /datum/data/extraction_cargo("Fishing Mod (B) ", /obj/item/workshop_mod/fishing/black, 200) = 1,
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

/obj/structure/destructible/fishing_net/proc/SpawnEnemy(turf/dropoff, mob/user)
var/spawning = /mob/living/simple_animal/hostile/shrimp
if(prob(1) && SSfishing.Mars == 4)
if(prob(1) && SSfishing.IsAligned(/datum/planet/mars))
spawning = /mob/living/simple_animal/hostile/distortion/shrimp_rambo/easy

if(prob(5)) //Super rares first
Expand Down
8 changes: 4 additions & 4 deletions ModularTegustation/fishing/code/fishing_items/fishing_rod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,14 @@
var/size_modifier = rand(1, 4) * 0.1
//Size modifier has to be a decimal in order to keep it from making massive fish.
//Gets bonuses if mercury is in alignment, and if you're aligned with the mercury god
if(SSfishing.Mercury == 2)
size_modifier*=1.3
if(SSfishing.IsAligned(/datum/planet/mercury))
size_modifier *= 1.3
to_chat(user, span_nicegreen("[FISHGOD_MERCURY] smiles upon you!."))

if(user.god_aligned == FISHGOD_MERCURY)
size_modifier*=2

fishie.randomize_weight_and_size(size_modifier)
if(SSfishing.Mercury == 2)
to_chat(user, span_nicegreen("Lir smiles upon you!."))

if(user.god_aligned == FISHGOD_URANUS && prob(5))
to_chat(user, span_nicegreen("Abena Mansa smiles upon you! You caught some cash!"))
Expand Down
90 changes: 25 additions & 65 deletions ModularTegustation/fishing/code/fishing_items/fishing_shrine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,22 @@
if(FISH_RARITY_GOOD_LUCK_FINDING_THIS)
this_fish_point = 0.8
if(sacrificing.status == FISH_ALIVE)
this_fish_point*=2
if(SSfishing.Neptune==8)
this_fish_point*=2
this_fish_point *= 2

var/neptune = SSfishing.IsAligned(/datum/planet/neptune)
if(neptune) //If neptune is aligned, double your points
this_fish_point *= 2

qdel(I)
user.devotion+=this_fish_point
if(SSfishing.Neptune==8)
to_chat(user, span_notice("Neptune is in alignment. Devotion increased by [this_fish_point]. Your devotion to [user.god_aligned] is now [user.devotion]."))
else
to_chat(user, span_notice("Devotion increased by [this_fish_point]. Your devotion to [user.god_aligned] is now [user.devotion]."))

to_chat(user, span_notice("[neptune ? "Neptune is in alignment. " : ""]Devotion increased by [this_fish_point]. Your devotion to [user.god_aligned] is now [user.devotion]."))

/obj/structure/fishshrine/attack_hand(mob/living/user)
..()
if(user.devotion>=1&& user.devotion<5)
if(user.devotion >= 1 && user.devotion < 5)
to_chat(user, span_notice("The gods look the other way."))
return
if(user.devotion>=5 && user.god_aligned == FISHGOD_NONE)
if(user.devotion >= 5 && user.god_aligned == FISHGOD_NONE)
pick_god(user)
if(user.god_aligned != FISHGOD_NONE)
display_info(user)
Expand All @@ -60,68 +59,29 @@
if(4)
to_chat(user, span_notice("The moon is Full."))

if(SSfishing.Mercury == 2)
to_chat(user, span_notice("Mercury is in alignment with earth."))
if(SSfishing.Venus == 3)
to_chat(user, span_notice("Venus is in alignment with earth."))
if(SSfishing.Mars == 4)
to_chat(user, span_notice("Mars is in alignment with earth."))
if(SSfishing.Jupiter == 5)
to_chat(user, span_notice("Jupiter is in alignment with earth."))
if(SSfishing.Saturn == 6)
to_chat(user, span_notice("Saturn is in alignment with earth."))
if(SSfishing.Uranus == 7)
to_chat(user, span_notice("Uranus is in alignment with earth."))
if(SSfishing.Neptune == 8)
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."))

//Godpicking shit
/obj/structure/fishshrine/proc/pick_god(mob/living/user)
var/list/display_names = list("Lir", "Tefnut", "Arnapkapfaaluk", "Susanoo" , "Kukulkan", "Abena Mansa", "Glaucus")
if(!display_names.len)
var/list/god_names = list()
for(var/datum/planet/planet as anything in SSfishing.planets)
god_names[planet.god] = planet.god_desc

for(var/god as anything in SSfishing.sleeping_gods)
god_names[god] = "Warning, [god]'s planet has been destroyed, this can negativelly affect you in several situations.\n[SSfishing.sleeping_gods[god]]"

if(!length(god_names))
return
var/choice = input(user,"Which god would you like to align yourself with?","Select a god") as null|anything in display_names

var/choice = input(user, "Which god would you like to align yourself with?", "Select a god") as null|anything in god_names
if(!choice || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
to_chat(user, span_notice("You decide to stay a fish athiest for now."))
return

switch(choice)
if("Lir")
var/confirm = alert("Lir is the God of The Sea, and represents Mercury. Devoting yourself to Lir will give you better fortune with the sizes of fish.", "God Choser", "Devote Yourself", "Take more time")
if(confirm == "Devote Yourself")
user.god_aligned = FISHGOD_MERCURY

if("Tefnut")
var/confirm = alert("Tefnut is the Goddess of moisture, fertility and water, and represents Venus. Devoting yourself to Tefnut will make it less likely for enemies to spawn while catching with nets.", "God Choser", "Devote Yourself", "Take more time")
if(confirm == "Devote Yourself")
user.god_aligned = FISHGOD_VENUS

if("Arnapkapfaaluk")
var/confirm = alert("Arnapkapfaaluk is the Goddess of aquatic combat, and represents Mars. Devoting yourself to Arnapkapfaaluk will give you strength with fishing weapons.", "God Choser", "Devote Yourself", "Take more time")
if(confirm == "Devote Yourself")
user.god_aligned = FISHGOD_MARS

if("Susanoo")
var/confirm = alert("Susanoo is the God of harvest and storms, and represents Jupiter. Devoting yourself to Susanoo will make fishing weapons heal on kill.", "God Choser", "Devote Yourself", "Take more time")
if(confirm == "Devote Yourself")
user.god_aligned = FISHGOD_JUPITER

if("Kukulkan")
var/confirm = alert("Kukulkan is the Serpent Deity, and represents Saturn. Devoting yourself to Kukulkan will decrease the cost of all spells by 1 devotion.", "God Choser", "Devote Yourself", "Take more time")
if(confirm == "Devote Yourself")
user.god_aligned = FISHGOD_SATURN

if("Abena Mansa")
var/confirm = alert("Abena Mansa is a sea Goddess of gold, and represents Uranus. Devoting yourself to Abena Mansa will make fishing up ahn possible, scaling with your devotion.", "God Choser", "Devote Yourself", "Take more time")
if(confirm == "Devote Yourself")
user.god_aligned = FISHGOD_URANUS

if("Glaucus")
var/confirm = alert("Glaucus is the God of fishing, and represents Neptune. Devoting yourself to Glaucus will enhance all of your fishing skills.", "God Choser", "Devote Yourself", "Take more time")
if(confirm == "Devote Yourself")
user.god_aligned = FISHGOD_NEPTUNE

if(alert(god_names[choice], "God Choser", "Devote Yourself", "Take more time") != "Devote Yourself")
return

user.god_aligned = choice
to_chat(user, span_notice("You devote yourself to [user.god_aligned]."))
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,39 @@
finisheddesc = "A finished harpoon, ready for use. Deals less damage to non-aquatic enemies."

//Update with aquatic enemies
var/list/aquatic_enemies = list(/mob/living/simple_animal/hostile/shrimp,
/mob/living/simple_animal/hostile/distortion/shrimp_rambo/easy,
/mob/living/simple_animal/hostile/shrimp_soldier,
/mob/living/simple_animal/hostile/shrimp_rifleman,
/mob/living/simple_animal/hostile/senior_shrimp,)
var/list/aquatic_enemies = list(
/mob/living/simple_animal/hostile/shrimp,
/mob/living/simple_animal/hostile/distortion/shrimp_rambo/easy,
/mob/living/simple_animal/hostile/shrimp_soldier,
/mob/living/simple_animal/hostile/shrimp_rifleman,
/mob/living/simple_animal/hostile/senior_shrimp,
)



/obj/item/ego_weapon/template/fishing/attack(mob/living/target, mob/living/user)
var/finishedforce = force
var/storelive = FALSE
if(user.god_aligned == FISHGOD_MARS)
force*=1.3

if(!(target.status_flags & GODMODE) && target.stat != DEAD)
storelive = TRUE

if(SSfishing.Mars == 4) //Big-air bonus for mars being in alignment
force*=1.3
if(user.god_aligned == FISHGOD_MARS)
force *= 1.3

if(SSfishing.IsAligned(/datum/planet/mars)) //Big-air bonus for mars being in alignment
force *= 1.3

if(!(target.type in aquatic_enemies))
force*=0.7
force *= 0.7
..()
if(target.stat == DEAD && storelive)
if(user.god_aligned == FISHGOD_JUPITER)
user.adjustBruteLoss(-user.maxHealth*0.1) //Healing for your kill
new /obj/effect/temp_visual/heal(get_turf(user), "#FF4444")

if(SSfishing.Jupiter == 5)
if(SSfishing.IsAligned(/datum/planet/jupiter))
user.adjustBruteLoss(-user.maxHealth*0.05) //Healing for your kill
new /obj/effect/temp_visual/heal(get_turf(user), "#FF4444")

force = finishedforce


/obj/item/ego_weapon/template/fishing/spear
name = "fishing spear template"
desc = "A blank fishing spear workshop template."
Expand Down
Loading

0 comments on commit 713fa3e

Please sign in to comment.