Skip to content

Commit

Permalink
can now work on pedang
Browse files Browse the repository at this point in the history
  • Loading branch information
FalloutFalcon committed Sep 19, 2024
1 parent 071b117 commit 198bab2
Show file tree
Hide file tree
Showing 15 changed files with 76 additions and 90 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@
/area/overmap_encounter/planetoid/lava/explored)
"zb" = (
/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner{
loot = list(/obj/item/melee/transforming/cleaving_saw,/obj/item/gun/energy/kinetic_accelerator,/obj/item/keycard/gatedrop/lavacanyon);
loot = list(/obj/item/melee/cleaving_saw,/obj/item/gun/energy/kinetic_accelerator,/obj/item/keycard/gatedrop/lavacanyon);
},
/turf/open/floor/plating/asteroid/basalt/lava_land_surface,
/area/overmap_encounter/planetoid/cave/explored)
Expand Down
2 changes: 1 addition & 1 deletion _maps/shuttles/roumain/srm_elder.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@
/obj/vehicle/ridden/wheelchair{
dir = 4
},
/obj/item/melee/transforming/cleaving_saw/old,
/obj/item/melee/cleaving_saw/old,
/turf/open/floor/ship/dirt/dark,
/area/ship/bridge)
"rj" = (
Expand Down
3 changes: 0 additions & 3 deletions code/datums/components/twohanded.dm
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,9 @@

if(!wielded)
return NONE
/*
if(!icon_wielded)
return NONE
source.icon_state = icon_wielded
*/
source.icon_state = "[icon_wielded]_w"
return COMSIG_ATOM_NO_UPDATE_ICON_STATE
/**
* on_moved Triggers on item moved
Expand Down
2 changes: 1 addition & 1 deletion code/game/MapData/shuttles/srm_elder.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/obj/item/melee/transforming/cleaving_saw/old
/obj/item/melee/cleaving_saw/old
name = "old cleaving saw"
desc = "This saw, old and rusted, is still an effective tool at bleeding beasts and monsters."
force = 10
Expand Down
6 changes: 3 additions & 3 deletions code/game/gamemodes/clown_ops/clown_weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,20 @@
* is active or not.
*/
/obj/item/melee/transforming/energy/sword/proc/adjust_slipperiness()
if(active)
if(HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE))
AddComponent(/datum/component/slippery, 60, GALOSHES_DONT_HELP)
else
qdel(GetComponent(/datum/component/slippery))

/obj/item/melee/transforming/energy/sword/bananium/attack(mob/living/M, mob/living/user)
..()
if(active)
if(HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE))
var/datum/component/slippery/slipper = GetComponent(/datum/component/slippery)
slipper.Slip(src, M)

/obj/item/melee/transforming/energy/sword/bananium/throw_impact(atom/hit_atom, throwingdatum)
. = ..()
if(active)
if(HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE))
var/datum/component/slippery/slipper = GetComponent(/datum/component/slippery)
slipper.Slip(src, hit_atom)

Expand Down
62 changes: 34 additions & 28 deletions code/game/objects/items/melee/energy.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/obj/item/melee/transforming/energy
icon = 'icons/obj/weapon/energy.dmi'
active_hitsound = 'sound/weapons/blade1.ogg'
heat = 3500
heat = 0
max_integrity = 200
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 30)
resistance_flags = FIRE_PROOF
Expand All @@ -10,10 +10,12 @@
light_power = 1
light_on = FALSE
var/sword_color
/// The heat given off when active.
var/active_heat = 3500

/obj/item/melee/transforming/energy/Initialize()
. = ..()
if(active)
if(HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE))
START_PROCESSING(SSobj, src)

/obj/item/melee/transforming/energy/Destroy()
Expand All @@ -24,28 +26,36 @@
return FALSE

/obj/item/melee/transforming/energy/get_sharpness()
return active * sharpness
return sharpness

/obj/item/melee/transforming/energy/process()
open_flame()
/obj/item/melee/transforming/energy/process(seconds_per_tick)
if(heat)
open_flame()

/obj/item/melee/transforming/energy/on_transform(obj/item/source, mob/user, active)
. = ..()
if(.)
if(active)
if(sword_color)
icon_state = "[base_icon_state][sword_color]"
START_PROCESSING(SSobj, src)
else
STOP_PROCESSING(SSobj, src)
set_light_on(active)
if(active)
heat = active_heat
START_PROCESSING(SSobj, src)
if(sword_color)
icon_state = "[base_icon_state][sword_color]"
else
heat = initial(heat)
STOP_PROCESSING(SSobj, src)

tool_behaviour = (active ? TOOL_SAW : NONE) //Lets energy weapons cut trees. Also lets them do bonecutting surgery, which is kinda metal!
if(user)
balloon_alert(user, "[name] [active ? "enabled":"disabled"]")
playsound(src, active ? 'sound/weapons/saberon.ogg' : 'sound/weapons/saberoff.ogg', 35, TRUE)
set_light_on(active)
update_appearance(UPDATE_ICON_STATE)

return COMPONENT_NO_DEFAULT_MESSAGE

/obj/item/melee/transforming/energy/get_temperature()
return active * heat
return heat

/obj/item/melee/transforming/energy/ignition_effect(atom/A, mob/user)
if(!active)
if(!HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE))
return ""

var/in_mouth = ""
Expand Down Expand Up @@ -96,13 +106,8 @@
armour_penetration = 35
block_chance = 50

/obj/item/melee/transforming/energy/sword/on_transform(obj/item/source, mob/user, active)
. = ..()
if(. && active && sword_color)
icon_state = "[base_icon_state][sword_color]"

/obj/item/melee/transforming/energy/sword/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
if(active)
if(HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE))
return ..()
return 0

Expand All @@ -113,7 +118,7 @@
/obj/item/melee/transforming/energy/sword/cyborg/attack(mob/M, mob/living/silicon/robot/R)
if(R.cell)
var/obj/item/stock_parts/cell/C = R.cell
if(active && !(C.use(hitcost)))
if(HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE) && !(C.use(hitcost)))
attack_self(R)
to_chat(R, "<span class='notice'>It's out of charge!</span>")
return
Expand Down Expand Up @@ -177,7 +182,7 @@
sword_color = "rainbow"
to_chat(user, "<span class='warning'>RNBW_ENGAGE</span>")

if(active)
if(HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE))
icon_state = "[base_icon_state]rainbow"
user.update_inv_hands()
else
Expand Down Expand Up @@ -212,12 +217,12 @@
/obj/item/melee/transforming/energy/blade
name = "energy blade"
desc = "A concentrated beam of energy in the shape of a blade. Very stylish... and lethal."
icon_state = "blade"
icon_state = "lightblade"
item_state = "lightblade"
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
force = 30 //Normal attacks deal esword damage
hitsound = 'sound/weapons/blade1.ogg'
active = 1
throwforce = 1 //Throwing or dropping the item deletes it.
throw_speed = 3
throw_range = 1
Expand Down Expand Up @@ -264,10 +269,11 @@

/obj/item/melee/transforming/energy/ctf/on_transform(obj/item/source, mob/user, active)
. = ..()
if(. && active)
icon_state = "plasmasword1"
if(active)
icon_state = "plasmasword_on"
playsound(user, active ? 'sound/weapons/SolGov_sword_arm.ogg' : 'sound/weapons/saberoff.ogg', 35, TRUE)
to_chat(user, "<span class='notice'>[src] [active ? "is now active":"can now be concealed"].</span>")
return COMPONENT_NO_DEFAULT_MESSAGE

/obj/item/melee/transforming/energy/ctf/solgov
armour_penetration = 40
Expand Down
75 changes: 29 additions & 46 deletions code/game/objects/items/melee/transforming.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
w_class = WEIGHT_CLASS_SMALL
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")

var/active = FALSE
/// Force while active.
var/active_force = 30
/// Throwforce while active.
Expand All @@ -14,8 +13,6 @@
var/active_hitsound = 'sound/weapons/blade1.ogg'
/// Weight class while active.
var/active_w_class = WEIGHT_CLASS_BULKY
/// The heat given off when active.
var/active_heat = 3500

var/list/attack_verb_on = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")

Expand All @@ -26,10 +23,6 @@
if(sharpness)
AddComponent(/datum/component/butchering, 50, 100, 0, hitsound)

/obj/item/melee/transforming/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()

/*
* Gives our item the transforming component, passing in our various vars.
*/
Expand All @@ -46,79 +39,69 @@
)
RegisterSignal(src, COMSIG_TRANSFORMING_ON_TRANSFORM, PROC_REF(on_transform))

/obj/item/melee/transforming/process(seconds_per_tick)
if(heat)
open_flame()

/obj/item/melee/transforming/proc/on_transform(obj/item/source, mob/user, active)
SIGNAL_HANDLER

if(active)
heat = active_heat
START_PROCESSING(SSobj, src)
else
heat = initial(heat)
STOP_PROCESSING(SSobj, src)
return

tool_behaviour = (active ? TOOL_SAW : NONE) //Lets energy weapons cut trees. Also lets them do bonecutting surgery, which is kinda metal!
if(user)
balloon_alert(user, "[name] [active ? "enabled":"disabled"]")
playsound(src, active ? 'sound/weapons/saberon.ogg' : 'sound/weapons/saberoff.ogg', 35, TRUE)
set_light_on(active)
update_appearance(UPDATE_ICON_STATE)
return COMPONENT_NO_DEFAULT_MESSAGE

/obj/item/melee/transforming/cleaving_saw
/obj/item/melee/cleaving_saw
name = "cleaving saw"
desc = "This saw, effective at drawing the blood of beasts, transforms into a long cleaver that makes use of centrifugal force."
force = 12
active_force = 20 //force when active
var/active_force = 20 //force when active
throwforce = 20
active_throwforce = 20
var/active_throwforce = 20
icon = 'icons/obj/lavaland/artefacts.dmi'
lefthand_file = 'icons/mob/inhands/64x64_lefthand.dmi'
righthand_file = 'icons/mob/inhands/64x64_righthand.dmi'
inhand_x_dimension = 64
inhand_y_dimension = 64
icon_state = "cleaving_saw"
item_state = "cleaving_saw"
slot_flags = ITEM_SLOT_BELT
attack_verb = list("attacked", "sawed", "sliced", "torn", "ripped", "diced", "cut")
attack_verb_on = list("cleaved", "swiped", "slashed", "chopped")
hitsound = 'sound/weapons/bladeslice.ogg'
active_hitsound = 'sound/weapons/bladeslice.ogg'
w_class = WEIGHT_CLASS_BULKY
sharpness = IS_SHARP

var/transform_cooldown
var/swiping = FALSE
var/bleed_stacks_per_hit = 3

/obj/item/melee/transforming/cleaving_saw/examine(mob/user)
/obj/item/melee/cleaving_saw/Initialize(mapload)
. = ..()
. += "<span class='notice'>It is [active ? "open, will cleave enemies in a wide arc and deal additional damage to fauna":"closed, and can be used for rapid consecutive attacks that cause fauna to bleed"].\n"+\
"Both modes will build up existing bleed effects, doing a burst of high damage if the bleed is built up high enough.\n"+\
"Transforming it immediately after an attack causes the next attack to come out faster.</span>"
AddElement(/datum/element/update_icon_updates_onmob)
AddComponent(/datum/component/butchering, 50, 100, 0, hitsound)
AddComponent( \
/datum/component/transforming, \
transform_cooldown_time = (CLICK_CD_MELEE * 0.25), \
force_on = active_force, \
throwforce_on = active_throwforce, \
attack_verb_on = list("cleave", "swipe", "slash", "chop"), \
)
RegisterSignal(src, COMSIG_TRANSFORMING_ON_TRANSFORM, PROC_REF(on_transform))

/obj/item/melee/transforming/cleaving_saw/on_transform(obj/item/source, mob/user, active)
if(transform_cooldown > world.time)
return FALSE
/obj/item/melee/cleaving_saw/examine(mob/user)
. = ..()
if(.)
transform_cooldown = world.time + (CLICK_CD_MELEE * 0.5)
user.changeNext_move(CLICK_CD_MELEE * 0.25)
. += span_notice("It is [HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE) ? "open, will cleave enemies in a wide arc and deal additional damage to fauna":"closed, and can be used for rapid consecutive attacks that cause fauna to bleed"].")
. += span_notice("Both modes will build up existing bleed effects, doing a burst of high damage if the bleed is built up high enough.")
. += span_notice("Transforming it immediately after an attack causes the next attack to come out faster.")

/obj/item/melee/cleaving_saw/proc/on_transform(obj/item/source, mob/user, active)
SIGNAL_HANDLER
if(active)
to_chat(user, "<span class='notice'>You open [src]. It will now cleave enemies in a wide arc and deal additional damage to fauna.</span>")
else
to_chat(user, "<span class='notice'>You close [src]. It will now attack rapidly and cause fauna to bleed.</span>")
playsound(user, 'sound/magic/clockwork/fellowship_armory.ogg', 35, TRUE, frequency = 90000 - (active * 30000))
return COMPONENT_NO_DEFAULT_MESSAGE

/obj/item/melee/transforming/cleaving_saw/melee_attack_chain(mob/user, atom/target, params)
..()
if(!active)
/obj/item/melee/cleaving_saw/melee_attack_chain(mob/user, atom/target, params)
. = ..()
if(!HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE))
user.changeNext_move(CLICK_CD_MELEE * 0.5) //when closed, it attacks very rapidly

/obj/item/melee/transforming/cleaving_saw/attack(mob/living/target, mob/living/carbon/human/user)
if(!active || swiping || !target.density || get_turf(target) == get_turf(user))
/obj/item/melee/cleaving_saw/attack(mob/living/target, mob/living/carbon/human/user)
if(!HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE) || swiping || !target.density || get_turf(target) == get_turf(user))
..()
else
var/turf/user_turf = get_turf(user)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/cargo/exports/lavaland.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
cost = 40000
unit_name = "major lava planet artifact"
export_types = list(/obj/item/hierophant_club,
/obj/item/melee/transforming/cleaving_saw,
/obj/item/melee/cleaving_saw,
/obj/item/organ/vocal_cords/colossus,
/obj/machinery/anomalous_crystal,
/obj/item/mayhem,
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/spacesuits/miscellaneous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ Contains:
armor = list("melee" = 30, "bullet" = 10, "laser" = 10, "energy" = 20, "bomb" = 10, "bio" = 100, "rad" = 10, "fire" = 100, "acid" = 100)
max_heat_protection_temperature = FIRE_IMMUNITY_MAX_TEMP_PROTECT
resistance_flags = FIRE_PROOF
allowed = list(/obj/item/flashlight, /obj/item/tank/internals, /obj/item/pickaxe, /obj/item/melee/spear, /obj/item/organ/regenerative_core/legion, /obj/item/kinetic_crusher, /obj/item/resonator, /obj/item/melee/transforming/cleaving_saw)
allowed = list(/obj/item/flashlight, /obj/item/tank/internals, /obj/item/pickaxe, /obj/item/melee/spear, /obj/item/organ/regenerative_core/legion, /obj/item/kinetic_crusher, /obj/item/resonator, /obj/item/melee/cleaving_saw)

/obj/item/clothing/suit/space/hardsuit/berserker/RemoveHelmet()
var/obj/item/clothing/head/helmet/space/hardsuit/berserker/helm = helmet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ Difficulty: Medium
pixel_x = -16
base_pixel_x = -16
//mob_trophy = /obj/item/mob_trophy/miner_eye
loot = list(/obj/item/melee/transforming/cleaving_saw, /obj/item/gun/energy/kinetic_accelerator)
loot = list(/obj/item/melee/cleaving_saw, /obj/item/gun/energy/kinetic_accelerator)
wander = FALSE
del_on_death = TRUE
blood_volume = BLOOD_VOLUME_NORMAL
gps_name = "Resonant Signal"
achievement_type = /datum/award/achievement/boss/blood_miner_kill
crusher_achievement_type = /datum/award/achievement/boss/blood_miner_crusher
score_achievement_type = /datum/award/score/blood_miner_score
var/obj/item/melee/transforming/cleaving_saw/miner/miner_saw
var/obj/item/melee/cleaving_saw/miner/miner_saw
var/time_until_next_transform = 0
var/dashing = FALSE
var/dash_cooldown = 15
Expand Down Expand Up @@ -107,11 +107,11 @@ Difficulty: Medium
shoot_ka()
transform_weapon()

/obj/item/melee/transforming/cleaving_saw/miner //nerfed saw because it is very murdery
/obj/item/melee/cleaving_saw/miner //nerfed saw because it is very murdery
force = 6
active_force = 10

/obj/item/melee/transforming/cleaving_saw/miner/attack(mob/living/target, mob/living/carbon/human/user)
/obj/item/melee/cleaving_saw/miner/attack(mob/living/target, mob/living/carbon/human/user)
target.add_stun_absorption("miner", 10, INFINITY)
..()
target.stun_absorption -= "miner"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/unit_tests/icons/worn_icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@

#ifdef EXTRA_ICON_TESTS
//The exact same test expect this time we warn instead of fail because most items dont really NEED to apear on a player
for(var/obj/item/item_path as anything in (subtypesof(/obj/item) - (typesof(/obj/item/clothing) + typesof(/obj/item/mod))))
for(var/obj/item/item_path as anything in (subtypesof(/obj/item/melee) + subtypesof(/obj/item/gun)))
var/cached_slot_flags = initial(item_path.slot_flags)
if(!cached_slot_flags || (cached_slot_flags & ITEM_SLOT_LPOCKET) || (cached_slot_flags & ITEM_SLOT_RPOCKET) || initial(item_path.item_flags) & ABSTRACT || isbadpath(item_path))
continue
Expand Down
Binary file modified icons/mob/inhands/64x64_lefthand.dmi
Binary file not shown.
Binary file modified icons/mob/inhands/64x64_righthand.dmi
Binary file not shown.
Binary file modified icons/mob/inhands/weapons/swords_lefthand.dmi
Binary file not shown.
Binary file modified icons/mob/inhands/weapons/swords_righthand.dmi
Binary file not shown.

0 comments on commit 198bab2

Please sign in to comment.