Skip to content

Commit

Permalink
Removes unused crystal code for xenos (#5287)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->

# About the pull request

Removes a bunch of unused code for a historical resource collection
system.

# Explain why it's good for the game

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding, and may discourage maintainers from reviewing or merging
your PR. This section is not strictly required for (non-controversial)
fix PRs or backend PRs. -->


# Testing Photographs and Procedure
<!-- Include any screenshots/videos/debugging steps of the modified code
functioning successfully, ideally including edge cases. -->
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
label your changes in the changelog. Please note that maintainers freely
reserve the right to remove and add tags should they deem it
appropriate. You can attempt to finagle the system all you want, but
it's best to shoot for clear communication right off the bat. -->
<!-- If you add a name after the ':cl', that name will be used in the
changelog. You must add your CKEY after the CL if your GitHub name
doesn't match. Maintainers freely reserve the right to remove and add
tags should they deem it appropriate. -->

:cl:
del: Removed old crystal code from xenos
code: Renames still used vars from crystal to plasma
code: Removes crystal define in place of plasma string
/:cl:

<!-- Both :cl:'s are required for the changelog to work! -->
  • Loading branch information
Birdtalon authored Dec 26, 2023
1 parent 47a18d5 commit 2c6b393
Show file tree
Hide file tree
Showing 17 changed files with 15 additions and 76 deletions.
1 change: 0 additions & 1 deletion code/__DEFINES/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@
#define MATERIAL_METAL "metal"
#define MATERIAL_PLASTEEL "plasteel"
#define MATERIAL_WOOD "wood plank"
#define MATERIAL_CRYSTAL "plasmagas"

// SIZES FOR ITEMS, use it for w_class

Expand Down
5 changes: 0 additions & 5 deletions code/__DEFINES/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,6 @@
#define XENO_PLASMA_TIER_8 800 * XENO_UNIVERSAL_PLASMAMULT
#define XENO_PLASMA_TIER_10 1000 * XENO_UNIVERSAL_PLASMAMULT

// Resource stockpile bands
#define XENO_CRYSTAL_LOW 50
#define XENO_CRYSTAL_MEDIUM 100
#define XENO_CRYSTAL_HIGH 150

// Plasma gain bands
#define XENO_PLASMA_GAIN_TIER_1 1
#define XENO_PLASMA_GAIN_TIER_2 1.5
Expand Down
40 changes: 8 additions & 32 deletions code/datums/construction/construction_template.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
var/pixel_y = -16
var/pixel_x = -16

var/crystals_required = 0
var/crystals_stored = 0
var/plasma_required = 0
var/plasma_stored = 0
var/materials_required = list() //Example resource requirements i.e. MATERIAL_METAL = 1
var/extras_required = list() //Example extra requirements i.e. /obj/item = 1

Expand Down Expand Up @@ -43,47 +43,23 @@
return
if(!xeno.plasma_max)
return
if(crystals_stored >= crystals_required)
if(plasma_stored >= plasma_required)
to_chat(xeno, SPAN_WARNING("\The [name] does not require plasma."))
return
to_chat(xeno, SPAN_NOTICE("You begin adding \the plasma to \the [name]."))
xeno_attack_delay(xeno)
if(!do_after(xeno, 40, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD))
return
//double-check amount required
if(crystals_stored >= crystals_required)
if(plasma_stored >= plasma_required)
to_chat(xeno, SPAN_WARNING("\The [name] has enough plasma."))
return
var/amount_to_use = min(xeno.plasma_stored, (crystals_required - crystals_stored))
crystals_stored += amount_to_use
var/amount_to_use = min(xeno.plasma_stored, (plasma_required - plasma_stored))
plasma_stored += amount_to_use
xeno.plasma_stored -= amount_to_use
to_chat(xeno, SPAN_WARNING("\The [name] requires [crystals_required - crystals_stored] more plasma."))
to_chat(xeno, SPAN_WARNING("\The [name] requires [plasma_required - plasma_stored] more plasma."))
check_completion()

// Xeno ressource collection
/*
/datum/construction_template/proc/add_crystal(mob/living/carbon/xenomorph/M)
if(!istype(M))
return
if(!M.crystal_stored)
to_chat(M, SPAN_WARNING("You have no [MATERIAL_CRYSTAL] stored."))
return
if(crystals_stored >= crystals_required)
to_chat(M, SPAN_WARNING("\The [name] does not require [MATERIAL_CRYSTAL]."))
return
to_chat(M, SPAN_NOTICE("You begin adding \the [MATERIAL_CRYSTAL] to \the [name]."))
if(!do_after(M, 40, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD))
return
//double-check amount required
if(crystals_stored >= crystals_required)
to_chat(M, SPAN_WARNING("\The [name] has enough [MATERIAL_CRYSTAL]."))
return
var/amount_to_use = min(M.crystal_stored, (crystals_required - crystals_stored))
crystals_stored += amount_to_use
M.crystal_stored -= amount_to_use
to_chat(M, SPAN_WARNING("\The [name] requires [crystals_required - crystals_stored] more [MATERIAL_CRYSTAL]."))
check_completion() */

/datum/construction_template/proc/add_material(mob/user, obj/item/I)
if(isStack(I))
var/obj/item/stack/S = I
Expand Down Expand Up @@ -123,7 +99,7 @@
check_completion()

/datum/construction_template/proc/check_completion()
if(crystals_stored < crystals_required)
if(plasma_stored < plasma_required)
return FALSE
for(var/material_req in materials_required)
if(materials_required[material_req] > 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/datum/construction_template/xenomorph
name = "xenomorph structure"
build_type = /obj/effect/alien/resin/special
crystals_required = 45 * XENO_STRUCTURE_PLASMA_MULTIPLIER
plasma_required = 45 * XENO_STRUCTURE_PLASMA_MULTIPLIER
/// The hive that this structure belongs to.
var/datum/hive_status/hive_ref
/// The range around this structure which needs to be clear for it to be constructed.
Expand All @@ -29,7 +29,7 @@
description = "Heart of the hive, grows hive weeds (which are necessary for other structures), stores larva, spawns lesser drones, and protects the hive from skyfire."
build_type = /obj/effect/alien/resin/special/pylon/core
build_icon_state = "core"
crystals_required = 100 * XENO_STRUCTURE_PLASMA_MULTIPLIER
plasma_required = 100 * XENO_STRUCTURE_PLASMA_MULTIPLIER
block_range = 0

/datum/construction_template/xenomorph/cluster
Expand All @@ -39,7 +39,7 @@
build_icon_state = "hive_cluster"
pixel_y = -8
pixel_x = -8
crystals_required = 50 * XENO_STRUCTURE_PLASMA_MULTIPLIER
plasma_required = 50 * XENO_STRUCTURE_PLASMA_MULTIPLIER
block_range = 0

/datum/construction_template/xenomorph/cluster/set_structure_image()
Expand All @@ -50,7 +50,7 @@
description = "Remote section of the hive, grows hive weeds, spawns lesser drones, and protects sisters from air strikes."
build_type = /obj/effect/alien/resin/special/pylon
build_icon_state = "pylon"
crystals_required = 100 * XENO_STRUCTURE_PLASMA_MULTIPLIER
plasma_required = 100 * XENO_STRUCTURE_PLASMA_MULTIPLIER
block_range = 0

/datum/construction_template/xenomorph/eggmorph
Expand Down
2 changes: 0 additions & 2 deletions code/game/gamemodes/cm_initialize.dm
Original file line number Diff line number Diff line change
Expand Up @@ -734,8 +734,6 @@ Additional game mode variables.
to_chat(new_queen, "<B>You should start by building a hive core.</B>")
to_chat(new_queen, "Talk in Hivemind using <strong>;</strong> (e.g. ';Hello my children!')")

// Xeno ressource collection
//new_queen.crystal_stored = XENO_STARTING_CRYSTAL
new_queen.update_icons()

//===================================================\\
Expand Down
5 changes: 2 additions & 3 deletions code/modules/cm_aliens/structures/construction_node.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
color = linked_hive.color

/obj/effect/alien/resin/construction/Destroy()
if(template && linked_hive && (template.crystals_stored < template.crystals_required))
linked_hive.crystal_stored += template.crystals_stored
if(template && linked_hive && (template.plasma_stored < template.plasma_required))
linked_hive.remove_construction(src)
template = null
linked_hive = null
Expand All @@ -42,7 +41,7 @@
/obj/effect/alien/resin/construction/get_examine_text(mob/user)
. = ..()
if((isxeno(user) || isobserver(user)) && linked_hive)
var/message = "A [template.name] construction is designated here. It requires [template.crystals_required - template.crystals_stored] more [MATERIAL_CRYSTAL]."
var/message = "A [template.name] construction is designated here. It requires [template.plasma_required - template.plasma_stored] more plasma."
. += message

/obj/effect/alien/resin/construction/attack_alien(mob/living/carbon/xenomorph/M)
Expand Down
10 changes: 0 additions & 10 deletions code/modules/mob/living/carbon/xenomorph/Xenomorph.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@
var/crit_grace_time = 1 SECONDS
var/next_grace_time = 0

//Amount of construction resources stored internally
var/crystal_stored = 0
var/crystal_max = 0

var/evasion = 0 // RNG "Armor"

// Armor
Expand Down Expand Up @@ -847,7 +843,6 @@
/mob/living/carbon/xenomorph/proc/recalculate_stats()
recalculate_health()
recalculate_plasma()
recalculate_stockpile()
recalculate_speed()
recalculate_armor()
recalculate_damage()
Expand Down Expand Up @@ -887,11 +882,6 @@
if(plasma_stored > plasma_max)
plasma_stored = plasma_max

/mob/living/carbon/xenomorph/proc/recalculate_stockpile()
crystal_max = caste.crystal_max
if(crystal_stored > crystal_max)
crystal_stored = crystal_max

/mob/living/carbon/xenomorph/proc/recalculate_speed()
recalculate_move_delay = TRUE
speed = speed_modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@
if(!choice)
return
if(choice == "help")
var/message = "Placing a construction node creates a template for special structures that can benefit the hive, which require the insertion of [MATERIAL_CRYSTAL] to construct the following:<br>"
var/message = "Placing a construction node creates a template for special structures that can benefit the hive, which require the insertion of plasma to construct the following:<br>"
for(var/structure_name in X.hive.hive_structure_types)
var/datum/construction_template/xenomorph/structure_type = X.hive.hive_structure_types[structure_name]
message += "<b>[capitalize_first_letters(structure_name)]</b> - [initial(structure_type.description)]<br>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
max_health = XENO_HEALTH_TIER_6
plasma_gain = XENO_PLASMA_GAIN_TIER_8
plasma_max = XENO_PLASMA_TIER_6
crystal_max = XENO_CRYSTAL_LOW
xeno_explosion_resistance = XENO_EXPLOSIVE_ARMOR_TIER_4
armor_deflection = XENO_ARMOR_TIER_2
evasion = XENO_EVASION_NONE
Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
max_health = XENO_HEALTH_TIER_9
plasma_gain = XENO_PLASMA_GAIN_TIER_6
plasma_max = XENO_PLASMA_TIER_5
crystal_max = XENO_CRYSTAL_LOW
xeno_explosion_resistance = XENO_EXPLOSIVE_ARMOR_TIER_2
armor_deflection = XENO_NO_ARMOR
evasion = XENO_EVASION_NONE
Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/carbon/xenomorph/castes/Drone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
max_health = XENO_HEALTH_TIER_6
plasma_gain = XENO_PLASMA_GAIN_TIER_8
plasma_max = XENO_PLASMA_TIER_10
crystal_max = XENO_CRYSTAL_LOW
xeno_explosion_resistance = XENO_NO_EXPLOSIVE_ARMOR
armor_deflection = XENO_NO_ARMOR
evasion = XENO_EVASION_MEDIUM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
max_health = XENO_HEALTH_TIER_7
plasma_gain = XENO_PLASMA_GAIN_TIER_10
plasma_max = XENO_PLASMA_TIER_10
crystal_max = XENO_CRYSTAL_HIGH
xeno_explosion_resistance = XENO_EXPLOSIVE_ARMOR_TIER_1
armor_deflection = XENO_NO_ARMOR
evasion = XENO_EVASION_NONE
Expand Down
3 changes: 0 additions & 3 deletions code/modules/mob/living/carbon/xenomorph/castes/Queen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
max_health = XENO_HEALTH_QUEEN
plasma_gain = XENO_PLASMA_GAIN_TIER_7
plasma_max = XENO_PLASMA_TIER_10
crystal_max = XENO_CRYSTAL_MEDIUM
xeno_explosion_resistance = XENO_EXPLOSIVE_ARMOR_TIER_10
armor_deflection = XENO_ARMOR_TIER_2
evasion = XENO_EVASION_NONE
Expand Down Expand Up @@ -264,8 +263,6 @@
drag_delay = 6 //pulling a big dead xeno is hard
tier = 0 //Queen doesn't count towards population limit.
hive_pos = XENO_QUEEN
crystal_max = XENO_CRYSTAL_MEDIUM
crystal_stored = XENO_CRYSTAL_MEDIUM
small_explosives_stun = FALSE
pull_speed = 3 //screech/neurodragging is cancer, at the very absolute least get some runner to do it for teamwork

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
var/plasma_max = 10
var/plasma_gain = 5

var/crystal_max = 0

var/max_health = XENO_UNIVERSAL_HPMULT * 100
///Are they allowed to evolve (and have their evolution progress group)
var/evolution_allowed = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
max_health = XENO_HEALTH_LESSER_DRONE
plasma_gain = XENO_PLASMA_GAIN_TIER_7
plasma_max = XENO_PLASMA_TIER_3
crystal_max = XENO_CRYSTAL_LOW
xeno_explosion_resistance = XENO_NO_EXPLOSIVE_ARMOR
armor_deflection = XENO_NO_ARMOR
evasion = XENO_EVASION_LOW
Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/carbon/xenomorph/hive_status.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
var/isSlotOpen = TRUE //Set true for starting alerts only after the hive has reached its full potential
var/allowed_nest_distance = 15 //How far away do we allow nests from an ovied Queen. Default 15 tiles.
var/obj/effect/alien/resin/special/pylon/core/hive_location = null //Set to ref every time a core is built, for defining the hive location
var/crystal_stored = 0 //How much stockpiled material is stored for the hive to use.

var/datum/mutator_set/hive_mutators/mutators = new
var/tier_slot_multiplier = 1
Expand Down
7 changes: 0 additions & 7 deletions code/modules/mob/living/carbon/xenomorph/update_icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
update_inv_r_hand()
update_inv_l_hand()
update_inv_back()
update_inv_resource()
update_icons()

/* CRUTCH ZONE - Update icons when relevant status happen - Ideally do this properly and for everything, then kill update_icons() someday */
Expand Down Expand Up @@ -191,12 +190,6 @@
if(dir == NORTH && (back.flags_item & ITEM_OVERRIDE_NORTHFACE))
backpack_icon_holder.layer = -X_BACK_FRONT_LAYER

/mob/living/carbon/xenomorph/proc/update_inv_resource()
remove_overlay(X_RESOURCE_LAYER)
if(crystal_stored)
overlays_standing[X_RESOURCE_LAYER] = image("icon" = icon, "icon_state" = "[caste_type]_resources", "layer" =-X_RESOURCE_LAYER)
apply_overlay(X_RESOURCE_LAYER)

/mob/living/carbon/xenomorph/update_inv_legcuffed()
remove_overlay(X_LEGCUFF_LAYER)
if(legcuffed)
Expand Down

0 comments on commit 2c6b393

Please sign in to comment.