Skip to content

Commit

Permalink
сделал это модульно, кажис.... как же я заеблся
Browse files Browse the repository at this point in the history
  • Loading branch information
Lime-7 committed Oct 21, 2023
1 parent bc8add7 commit e490ebb
Show file tree
Hide file tree
Showing 21 changed files with 563 additions and 413 deletions.
1 change: 0 additions & 1 deletion code/game/mecha/mech_fabricator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
"Durand",
"H.O.N.K",
"Reticence",
"Executioner",
"Phazon",
"Exosuit Equipment",
"Cyborg Upgrade Modules",
Expand Down
2 changes: 0 additions & 2 deletions code/game/mecha/mecha.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@
var/smoke = 5
var/smoke_ready = 1
var/smoke_cooldown = 100
var/flash_ready = TRUE
var/flash_cooldown = 50
var/zoom_mode = FALSE
var/phasing = FALSE
var/phasing_energy_drain = 200
Expand Down
32 changes: 0 additions & 32 deletions code/game/mecha/mecha_actions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
var/datum/action/innate/mecha/mech_zoom/zoom_action = new
var/datum/action/innate/mecha/mech_toggle_phasing/phasing_action = new
var/datum/action/innate/mecha/mech_switch_damtype/switch_damtype_action = new
var/datum/action/innate/mecha/flash/flash_action = new

/obj/mecha/proc/GrantActions(mob/living/user, human_occupant = 0)
if(human_occupant)
Expand Down Expand Up @@ -233,34 +232,3 @@
playsound(src, 'sound/mecha/mechmove01.ogg', 50, 1)
UpdateButtonIcon()

/datum/action/innate/mecha/flash
name = "Святой огонь"
desc = "Очистите оскверненных тварей с помощью святого света!"
button_icon_state = "holyflash"

/datum/action/innate/mecha/flash/proc/flash_carbon(mob/living/carbon/M, mob/user = null, power = 5)
if(user)
add_attack_logs(user, M, "Flashed with [chassis]")
if(M.flash_eyes(1, 1))
M.AdjustConfused(power)
M.Stun(5)
M.Weaken(10)
to_chat(user, "<span class='danger'>Вы ослепили [M] священным светом!</span>")
to_chat(M, "<span class='userdanger'>[chassis] ослепил Вас с помощью священного света!</span>")
else
to_chat(user, "<span class='warning'>Вам не удалось ослепить [M] священным светом!</span>")
to_chat(M, "<span class='danger'>[chassis] не смог ослепить вас с помощью священного света!</span>")
return

/datum/action/innate/mecha/flash/Activate()
if(!owner || !chassis || chassis.occupant != owner)
return
if(chassis.flash_ready)
chassis.visible_message("<span class='disarm'>[chassis] emits a blinding holy light!</span>", "<span class='danger'>Your [chassis] emits a blinding holy light!</span>")
for(var/mob/living/carbon/M in oview(3, chassis))
flash_carbon(M, chassis.occupant, 3, FALSE)
chassis.flash_ready = FALSE
spawn(chassis.flash_cooldown)
chassis.flash_ready = TRUE
else
chassis.occupant_message("<span class='warning'>Святой свет ещё не готов!</span>")
309 changes: 0 additions & 309 deletions code/game/mecha/mecha_construction_paths.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1244,315 +1244,6 @@
holder.icon_state = "durand18"
return 1


/datum/construction/mecha/executioner_chassis
steps = list(
list("key"=/obj/item/mecha_parts/part/executioner_torso),//1
list("key"=/obj/item/mecha_parts/part/executioner_left_arm),//2
list("key"=/obj/item/mecha_parts/part/executioner_right_arm),//3
list("key"=/obj/item/mecha_parts/part/executioner_left_leg),//4
list("key"=/obj/item/mecha_parts/part/executioner_right_leg),//5
list("key"=/obj/item/mecha_parts/part/executioner_head)
)

/datum/construction/mecha/executioner_chassis/custom_action(step, atom/used_atom, mob/user)
user.visible_message("[user] has connected [used_atom] to the [holder].", "You connect [used_atom] to the [holder]")
holder.overlays += used_atom.icon_state+"+o"
qdel(used_atom)
return 1

/datum/construction/mecha/executioner_chassis/action(atom/used_atom,mob/user as mob)
return check_all_steps(used_atom,user)

/datum/construction/mecha/executioner_chassis/spawn_result()
..("mk. V \"The Executioner\"")
var/obj/item/mecha_parts/chassis/const_holder = holder
const_holder.construct = new /datum/construction/reversible/mecha/executioner(const_holder)
const_holder.icon = 'icons/mecha/mech_construction.dmi'
const_holder.icon_state = "executioner0"
const_holder.density = TRUE
qdel(src)
return

/datum/construction/reversible/mecha/executioner
result = "/obj/mecha/combat/executioner"
steps = list(
//1
list(
"key"=/obj/item/soulstone/anybody/purified,
"backkey"=null, //Cannot remove soulstone once it's in
"desc"="Soulstone puted in the locket."),
//2
"key" = /obj/item/mecha_parts/core,
"backkey" = TOOL_SCREWDRIVER,
"desc" = "External armor is welded."),
//3
list(
"key"=TOOL_WELDER,
"backkey"=TOOL_WRENCH,
"desc"="External armor is wrenched."),
//4
list(
"key"=TOOL_WRENCH,
"backkey"=TOOL_CROWBAR,
"desc"="External armor is installed."),
//5
list(
"key"=/obj/item/mecha_parts/part/executioner_armor,
"backkey"=TOOL_WELDER,
"desc"="Holy cross is welded."),
//6
list(
"key"=TOOL_WELDER,
"backkey"=TOOL_WRENCH,
"desc"="Holy cross is wrenched."),
//7
list("key"=TOOL_WRENCH,
"backkey"=TOOL_CROWBAR,
"desc"="Holy cross is installed."),
//8
list(
"key"=/obj/item/stack/sheet/mineral/silver,
"backkey"=TOOL_SCREWDRIVER,
"desc"="Holy helmet is blessed."),
//9
list(
"key"=/obj/item/storage/bible,
"backkey"=TOOL_CROWBAR,
"desc"="Holy helmet is installed."),
//10
list(
"key"=/obj/item/clothing/head/helmet/riot/knight/templar,
"backkey"=TOOL_SCREWDRIVER,
"desc"="Holy armour is blessed."),
//11
list(
"key"=/obj/item/storage/bible,
"backkey"=TOOL_CROWBAR,
"desc"="Holy armour is installed."),
//12
list(
"key"=/obj/item/clothing/suit/armor/riot/knight/templar,
"backkey"=TOOL_SCREWDRIVER,
"desc"="Scanning module is blessed."),
//13
list(
"key"=/obj/item/storage/bible,
"backkey"=TOOL_CROWBAR,
"desc"="Scanning module is installed."),
//14
list(
"key"=/obj/item/circuitboard/mecha/executioner/targeting,
"backkey"=TOOL_SCREWDRIVER,
"desc"="Peripherals control module is blessed."),
//15
list(
"key"=/obj/item/storage/bible,
"backkey"=TOOL_CROWBAR,
"desc"="Peripherals control module is installed."),
//16
list(
"key"=/obj/item/circuitboard/mecha/executioner/peripherals,
"backkey"=TOOL_SCREWDRIVER,
"desc"="Central control module is blessed."),
//17
list(
"key"=/obj/item/storage/bible,
"backkey"=TOOL_CROWBAR,
"desc"="Central control module is installed."),
//18
list(
"key"=/obj/item/circuitboard/mecha/executioner/main,
"backkey"=TOOL_SCREWDRIVER,
"desc"="The wiring is adjusted."),
//19
list(
"key"=/obj/item/wirecutters,
"backkey"=TOOL_SCREWDRIVER,
"desc"="The wiring is added."),
//20
list(
"key"=/obj/item/stack/cable_coil,
"backkey"=TOOL_SCREWDRIVER,
"desc"="The hydraulic systems are active."),
//21
list(
"key"=TOOL_SCREWDRIVER,
"backkey"=TOOL_WRENCH,
"desc"="The hydraulic systems are connected."),
//22
list(
"key"=TOOL_WRENCH,
"desc"="The hydraulic systems are disconnected.")
)


/datum/construction/reversible/mecha/executioner/action(atom/used_atom,mob/user as mob)
return check_step(used_atom,user)

/datum/construction/reversible/mecha/executioner/custom_action(index, diff, atom/used_atom, mob/user)
if(!..())
return 0

//TODO: better messages.
switch(index)
if(21)
user.visible_message("[user] connects the [holder] hydraulic systems", "You connect the [holder] hydraulic systems.")
holder.icon_state = "executioner1"
if(20)
if(diff==FORWARD)
user.visible_message("[user] activates the [holder] hydraulic systems.", "You activate the [holder] hydraulic systems.")
holder.icon_state = "executioner2"
else
user.visible_message("[user] disconnects the [holder] hydraulic systems", "You disconnect the [holder] hydraulic systems.")
holder.icon_state = "executioner0"
if(19)
if(diff==FORWARD)
user.visible_message("[user] adds the wiring to the [holder].", "You add the wiring to the [holder].")
holder.icon_state = "executioner3"
else
user.visible_message("[user] deactivates the [holder] hydraulic systems.", "You deactivate the [holder] hydraulic systems.")
holder.icon_state = "executioner1"
if(18)
if(diff==FORWARD)
user.visible_message("[user] adjusts the wiring of the [holder].", "You adjust the wiring of the [holder].")
holder.icon_state = "executioner4"
else
user.visible_message("[user] removes the wiring from the [holder].", "You remove the wiring from the [holder].")
var/obj/item/stack/cable_coil/coil = new /obj/item/stack/cable_coil(get_turf(holder))
coil.amount = 4
holder.icon_state = "executioner2"
if(17)
if(diff==FORWARD)
user.visible_message("[user] installs the central control module into the [holder].", "You install the central computer mainboard into the [holder].")
qdel(used_atom)
holder.icon_state = "executioner5"
else
user.visible_message("[user] disconnects the wiring of the [holder].", "You disconnect the wiring of the [holder].")
holder.icon_state = "executioner3"
if(16)
if(diff==FORWARD)
user.visible_message("[user] blessed the mainboard.", "You bless the mainboard.")
holder.icon_state = "executioner6"
else
user.visible_message("[user] removes the central control module from the [holder].", "You remove the central computer mainboard from the [holder].")
new /obj/item/circuitboard/mecha/executioner/main(get_turf(holder))
holder.icon_state = "executioner4"
if(15)
if(diff==FORWARD)
user.visible_message("[user] installs the peripherals control module into the [holder].", "You install the peripherals control module into the [holder].")
qdel(used_atom)
holder.icon_state = "executioner7"
else
user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
holder.icon_state = "executioner5"
if(14)
if(diff==FORWARD)
user.visible_message("[user] blessed the peripherals control module.", "You bless the peripherals control module.")
holder.icon_state = "executioner8"
else
user.visible_message("[user] removes the peripherals control module from the [holder].", "You remove the peripherals control module from the [holder].")
new /obj/item/circuitboard/mecha/executioner/peripherals(get_turf(holder))
holder.icon_state = "executioner6"
if(13)
if(diff==FORWARD)
user.visible_message("[user] installs the weapon control module into the [holder].", "You install the weapon control module into the [holder].")
qdel(used_atom)
holder.icon_state = "executioner9"
else
user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.")
holder.icon_state = "executioner7"
if(12)
if(diff==FORWARD)
user.visible_message("[user] blessed the weapon control module.", "You bless the weapon control module.")
holder.icon_state = "executioner10"
else
user.visible_message("[user] removes the weapon control module from the [holder].", "You remove the weapon control module from the [holder].")
new /obj/item/circuitboard/mecha/executioner/targeting(get_turf(holder))
holder.icon_state = "executioner8"
if(11)
if(diff==FORWARD)
user.visible_message("[user] installs the holy armour to the [holder].", "You install the holy armour to the [holder].")
qdel(used_atom)
holder.icon_state = "executioner11"
else
user.visible_message("[user] unfastens the weapon control module.", "You unfasten the weapon control module.")
holder.icon_state = "executioner9"
if(10)
if(diff==FORWARD)
user.visible_message("[user] blessed the holy armour.", "You bless the holy armour.")
holder.icon_state = "executioner12"
else
user.visible_message("[user] removes the holy armour from the [holder].", "You remove the holy armour from the [holder].")
new /obj/item/clothing/suit/armor/riot/knight/templar(get_turf(holder))
holder.icon_state = "executioner10"
if(9)
if(diff==FORWARD)
user.visible_message("[user] installs the holy helmet to the [holder].", "You install holy helmet to the [holder].")
qdel(used_atom)
holder.icon_state = "executioner13"
else
user.visible_message("[user] unfastens the phasic scanner module.", "You unfasten the phasic scanner module.")
holder.icon_state = "executioner11"
if(8)
if(diff==FORWARD)
user.visible_message("[user] blessed the holy helmet.", "You bless the holy helmet.")
holder.icon_state = "executioner14"
else
user.visible_message("[user] removes the holy helmet from the [holder].", "You remove the holy helmet from the [holder].")
new /obj/item/clothing/head/helmet/riot/knight/templar(get_turf(holder))
holder.icon_state = "executioner12"
if(7)
if(diff==FORWARD)
user.visible_message("[user] installs the holy cross to the [holder].", "You install the holy cross to the [holder].")
holder.icon_state = "executioner15"
else
user.visible_message("[user] unfastens the holy helmet.", "You unfasten the holy helmet.")
holder.icon_state = "executioner13"
if(6)
if(diff==FORWARD)
user.visible_message("[user] secures the holy cross.", "You secure the holy cross.")
holder.icon_state = "executioner16"
else
user.visible_message("[user] pries holy cross from the [holder].", "You pry holy cross from the [holder].")
var/obj/item/stack/sheet/metal/MS = new /obj/item/stack/sheet/mineral/silver(get_turf(holder))
MS.amount = 5
holder.icon_state = "executioner14"
if(5)
if(diff==FORWARD)
user.visible_message("[user] welds the holy cross to the [holder].", "You weld holy cross to the [holder].")
holder.icon_state = "executioner17"
else
user.visible_message("[user] unfastens the holy cross.", "You unfasten the holy cross.")
holder.icon_state = "executioner15"
if(4)
if(diff==FORWARD)
user.visible_message("[user] installs the Executioner Armor Plates to the [holder].", "You install Executioner Armor Plates to the [holder].")
qdel(used_atom)
holder.icon_state = "executioner18"
else
user.visible_message("[user] cuts the holy cross from the [holder].", "You cut the holy cross from the [holder].")
holder.icon_state = "executioner16"
if(3)
if(diff==FORWARD)
user.visible_message("[user] secures Executioner Armor Plates.", "You secure Executioner Armor Plates.")
holder.icon_state = "executioner19"
else
user.visible_message("[user] pries Executioner Armor Plates from the [holder].", "You pry Executioner Armor Plates from the [holder].")
new /obj/item/mecha_parts/part/durand_armor(get_turf(holder))
holder.icon_state = "executioner17"
if(2)
if(diff==FORWARD)
user.visible_message("[user] welds Executioner Armor Plates to the [holder].", "You weld Executioner Armor Plates to the [holder].")
else
user.visible_message("[user] unfastens Executioner Armor Plates.", "You unfasten Executioner Armor Plates.")
holder.icon_state = "executioner18"
if(1)
if(diff==FORWARD)
user.visible_message("[user] put soulstone to the [holder]'s locket. Exosuit seems awaken now.", "You put soulstone to the [holder]'s locket. Exosuit seems awaken now.")
qdel(used_atom)
return 1

//PHAZON

/datum/construction/mecha/phazon_chassis
Expand Down
Loading

0 comments on commit e490ebb

Please sign in to comment.