Skip to content

Commit

Permalink
pedang wip
Browse files Browse the repository at this point in the history
  • Loading branch information
FalloutFalcon committed Sep 19, 2024
1 parent 198bab2 commit 71a3bef
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
27 changes: 18 additions & 9 deletions code/game/objects/items/melee/bladeatheon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
/obj/item/melee/sword/pedang
name = "pedang"
desc = "an electrically-charged fencing sword."
icon_state = "suns-tsword"

force = 0
var/active_force = 10

var/obj/item/stock_parts/cell/cell
var/preload_cell_type = /obj/item/stock_parts/cell/pedang //if not empty the sabre starts with this type of cell
var/cell_hit_cost = 1000
var/can_remove_cell = TRUE

var/turned_on = FALSE
var/activate_sound = "sparks"

/obj/item/stock_parts/cell/pedang
Expand All @@ -27,22 +29,29 @@
/obj/item/melee/sword/pedang/Initialize()
. = ..()
if(preload_cell_type)
if(!ispath(preload_cell_type,/obj/item/stock_parts/cell))
log_mapping("[src] at [AREACOORD(src)] had an invalid preload_cell_type: [preload_cell_type].")
else
if(ispath(preload_cell_type, /obj/item/stock_parts/cell/pedang))
cell = new preload_cell_type(src)
update_appearance()

AddComponent( \
/datum/component/transforming, \
force_on = active_force, \
)
RegisterSignal(src, COMSIG_TRANSFORMING_ON_TRANSFORM, PROC_REF(on_transform))

/obj/item/melee/sword/pedang/proc/on_transform()
SIGNAL_HANDLER

playsound(src, activate_sound, 75, TRUE, -1)

/obj/item/melee/sword/pedang/Destroy()
if(cell)
QDEL_NULL(cell)
UnregisterSignal(src, COMSIG_PARENT_ATTACKBY)
return ..()

/obj/item/melee/baton/examine(mob/user)
/obj/item/melee/sword/pedang/examine(mob/user)
. = ..()
if(cell)
. += span_noitce("\The [src] is [round(cell.percent())]% charged.")
. += span_notice("\The [src] is [round(cell.percent())]% charged.")
else
. += span_warning("\The [src] does not have a power source installed.")

7 changes: 3 additions & 4 deletions code/game/objects/items/melee/transforming.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,9 @@

/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>")
user.changeNext_move(CLICK_CD_MELEE * 0.25)
if(user)
balloon_alert(user, "[active ? "opened" : "closed"] [src]")
playsound(user, 'sound/magic/clockwork/fellowship_armory.ogg', 35, TRUE, frequency = 90000 - (active * 30000))
return COMPONENT_NO_DEFAULT_MESSAGE

Expand Down
1 change: 1 addition & 0 deletions shiptest.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1312,6 +1312,7 @@
#include "code\game\objects\items\implants\implanter.dm"
#include "code\game\objects\items\implants\implantpad.dm"
#include "code\game\objects\items\implants\implantuplink.dm"
#include "code\game\objects\items\melee\bladeatheon.dm"
#include "code\game\objects\items\melee\chainsaw.dm"
#include "code\game\objects\items\melee\dualsaber.dm"
#include "code\game\objects\items\melee\energy.dm"
Expand Down

0 comments on commit 71a3bef

Please sign in to comment.