Skip to content

Commit

Permalink
A shocking PR (#2406)
Browse files Browse the repository at this point in the history
Adds a visual overlay for charge and organizes similar code

copypasta removal
  • Loading branch information
Coxswain-Navigator authored Sep 3, 2024
1 parent f5ab1bd commit 2339539
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 53 deletions.
Binary file modified ModularTegustation/Teguicons/lc13_coloreffect.dmi
Binary file not shown.
8 changes: 4 additions & 4 deletions ModularTegustation/tegu_items/associations/fixer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@
desc = "A kit containing Cane Office gear."

/obj/item/storage/box/fixerhard/cane/PopulateContents()
new /obj/item/ego_weapon/city/charge/cane/cane/weak(src)
new /obj/item/ego_weapon/city/charge/cane/claw/weak(src)
new /obj/item/ego_weapon/city/charge/cane/fist/weak(src)
new /obj/item/ego_weapon/city/charge/cane/briefcase/weak(src)
new /obj/item/ego_weapon/city/cane/cane/weak(src)
new /obj/item/ego_weapon/city/cane/claw/weak(src)
new /obj/item/ego_weapon/city/cane/fist/weak(src)
new /obj/item/ego_weapon/city/cane/briefcase/weak(src)
new /obj/item/clothing/under/suit/tuxedo(src)
new /obj/item/clothing/under/suit/tuxedo(src)
new /obj/item/clothing/under/suit/tuxedo(src)
48 changes: 48 additions & 0 deletions code/game/objects/effects/temporary_visuals/effect_indicators.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//Small visuals used for indicating damage or healing or similar
/obj/effect/temp_visual/healing
icon = 'ModularTegustation/Teguicons/lc13_coloreffect.dmi'
icon_state = "healing"
layer = ABOVE_ALL_MOB_LAYER
//duration based on the frames in the sprites.
duration = 8

/obj/effect/temp_visual/healing/Initialize(mapload)
. = ..()
pixel_x = rand(-12, 12)
pixel_y = rand(-9, 0)

/obj/effect/temp_visual/healing/no_dam
icon_state = "no_dam"

/obj/effect/temp_visual/healing/charge
icon_state = "charge"

/obj/effect/temp_visual/damage_effect
icon = 'ModularTegustation/Teguicons/lc13_coloreffect.dmi'
layer = ABOVE_ALL_MOB_LAYER
//Icon state is actually the base icon for intilization

/obj/effect/temp_visual/damage_effect/Initialize(mapload)
icon_state = "[icon_state][rand(1,2)]"
pixel_x = rand(-12, 12)
pixel_y = rand(-9, 9)
return ..()

/obj/effect/temp_visual/damage_effect/red
icon_state = "dam_red"

/obj/effect/temp_visual/damage_effect/white
icon_state = "dam_white"

/obj/effect/temp_visual/damage_effect/black
icon_state = "dam_black"

/obj/effect/temp_visual/damage_effect/pale
icon_state = "dam_pale"

//Stuntime visual for when you're stunned by your weapon, so you know what happened.
/obj/effect/temp_visual/weapon_stun
icon = 'ModularTegustation/Teguicons/lc13_coloreffect.dmi'
icon_state = "stun"
layer = ABOVE_ALL_MOB_LAYER
duration = 9
38 changes: 0 additions & 38 deletions code/game/objects/effects/temporary_visuals/miscellaneous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -849,44 +849,6 @@
pixel_y = 0
pixel_x = -16

/obj/effect/temp_visual/healing
icon_state = "healing"
layer = ABOVE_ALL_MOB_LAYER
//duration based on the frames in the sprites.
duration = 8

/obj/effect/temp_visual/healing/Initialize(mapload)
. = ..()
pixel_x = rand(-12, 12)
pixel_y = rand(-9, 0)

/obj/effect/temp_visual/healing/no_dam
icon_state = "no_dam"

//Damage Effects
/obj/effect/temp_visual/damage_effect
icon = 'ModularTegustation/Teguicons/lc13_coloreffect.dmi'
layer = ABOVE_ALL_MOB_LAYER
//Icon state is actually the base icon for intilization

/obj/effect/temp_visual/damage_effect/Initialize(mapload)
icon_state = "[icon_state][rand(1,2)]"
pixel_x = rand(-12, 12)
pixel_y = rand(-9, 9)
return ..()

/obj/effect/temp_visual/damage_effect/red
icon_state = "dam_red"

/obj/effect/temp_visual/damage_effect/white
icon_state = "dam_white"

/obj/effect/temp_visual/damage_effect/black
icon_state = "dam_black"

/obj/effect/temp_visual/damage_effect/pale
icon_state = "dam_pale"

/obj/effect/temp_visual/pale_eye_attack
name = "pale particles"
icon_state = "ion_fade_flight"
Expand Down
6 changes: 0 additions & 6 deletions code/game/objects/items/ego_weapons/_ego_weapon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,6 @@
CleanUp()
return ..()

//Stuntime visual for when you're stunned by your weapon, so you know what happened.
/obj/effect/temp_visual/weapon_stun
icon_state = "stun"
layer = ABOVE_ALL_MOB_LAYER
duration = 9

/obj/item/ego_weapon/MiddleClickAction(atom/target, mob/living/user)
. = ..()
if(. || !CanUseEgo(user))
Expand Down
15 changes: 14 additions & 1 deletion code/game/objects/items/ego_weapons/he.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,7 @@
charge = TRUE
attack_charge_gain = FALSE // we have a unique way of getting charge
charge_cost = 10
var/accumulated_charge = 0
charge_effect = "Teleport and create a temporary two-way portal."

var/current_holder
Expand Down Expand Up @@ -1102,6 +1103,18 @@
P2.link_portal(P1)
P1.teleport(user)

/obj/item/ego_weapon/warp/HandleCharge(added_charge) // Proc override so that charge icon appears every 1 charge gained
if(charge_amount < 0) // ???
charge_amount = initial(charge_amount)
CRASH("[src] has somehow aquired a negative charge amount, automatically reset it to the initial charge amount")

if(charge_amount < charge_cap)
charge_amount += added_charge
accumulated_charge += 1
if(accumulated_charge >= 10)
new /obj/effect/temp_visual/healing/charge(get_turf(src))
accumulated_charge = 0

/obj/effect/portal/warp
name = "dimensional rift"
desc = "A glowing, pulsating rift through space and time."
Expand All @@ -1117,7 +1130,7 @@
QDEL_IN(src, 3 SECONDS)
return ..()

/obj/item/ego_weapon/warp/knife //knife subtype of the above. knife has to be the subtype because it fits in a belt
/obj/item/ego_weapon/warp/knife // knife subtype of the above. knife has to be the subtype because it fits in a belt
name = "dimension shredder"
desc = "The path is intent on thwarting all attempts to memorize it."
icon_state = "warp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,31 +44,31 @@
)

//Cane is here too, mostly just need to lower requirements
/obj/item/ego_weapon/city/charge/cane/cane/weak
/obj/item/ego_weapon/city/cane/cane/weak
attribute_requirements = list(
FORTITUDE_ATTRIBUTE = 60,
PRUDENCE_ATTRIBUTE = 60,
TEMPERANCE_ATTRIBUTE = 60,
JUSTICE_ATTRIBUTE = 60
)

/obj/item/ego_weapon/city/charge/cane/claw/weak
/obj/item/ego_weapon/city/cane/claw/weak
attribute_requirements = list(
FORTITUDE_ATTRIBUTE = 60,
PRUDENCE_ATTRIBUTE = 60,
TEMPERANCE_ATTRIBUTE = 60,
JUSTICE_ATTRIBUTE = 60
)

/obj/item/ego_weapon/city/charge/cane/fist/weak
/obj/item/ego_weapon/city/cane/fist/weak
attribute_requirements = list(
FORTITUDE_ATTRIBUTE = 60,
PRUDENCE_ATTRIBUTE = 60,
TEMPERANCE_ATTRIBUTE = 60,
JUSTICE_ATTRIBUTE = 60
)

/obj/item/ego_weapon/city/charge/cane/briefcase/weak
/obj/item/ego_weapon/city/cane/briefcase/weak
attribute_requirements = list(
FORTITUDE_ATTRIBUTE = 60,
PRUDENCE_ATTRIBUTE = 60,
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/items/ego_weapons/subtype/charge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@

if(charge_amount < charge_cap)
charge_amount += added_charge
new /obj/effect/temp_visual/healing/charge(get_turf(src))

/// Lets people refund their charge if the allow_ability_cancel var is set to TRUE
/obj/item/ego_weapon/proc/CancelCharge(mob/user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@
new /obj/effect/temp_visual/healing/no_dam(get_turf(TB))

/mob/living/simple_animal/hostile/ordeal/centipede_corrosion/proc/AdjustCharge(addition)
if(addition > 0 && charge_level < charge_level_cap)
new /obj/effect/temp_visual/healing/charge(get_turf(src))
charge_level = clamp(charge_level + addition, 0, charge_level_cap)
update_icon()

Expand Down
1 change: 1 addition & 0 deletions code/modules/projectiles/guns/ego_gun/waw.dm
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@
/obj/item/gun/ego_gun/warring/proc/Build_Charge()
if(charge<=20)
charge+=1
new /obj/effect/temp_visual/healing/charge(get_turf(src))

/obj/item/gun/ego_gun/warring/can_shoot()
if(drawn == 0)
Expand Down
Binary file modified icons/effects/effects.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions lobotomy-corp13.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,7 @@
#include "code\game\objects\effects\spawners\vending.dm"
#include "code\game\objects\effects\spawners\xeno_egg_delivery.dm"
#include "code\game\objects\effects\temporary_visuals\cult.dm"
#include "code\game\objects\effects\temporary_visuals\effect_indicators.dm"
#include "code\game\objects\effects\temporary_visuals\miscellaneous.dm"
#include "code\game\objects\effects\temporary_visuals\temporary_visual.dm"
#include "code\game\objects\effects\temporary_visuals\projectiles\impact.dm"
Expand Down

0 comments on commit 2339539

Please sign in to comment.