Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*sigh* #122

Merged
merged 3 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2909,6 +2909,7 @@
#include "code\modules\psionics\equipment\psipower_blade.dm"
#include "code\modules\psionics\equipment\psipower_bow.dm"
#include "code\modules\psionics\equipment\psipower_elements.dm"
#include "code\modules\psionics\equipment\psipower_gun.dm"
#include "code\modules\psionics\equipment\psipower_surgery.dm"
#include "code\modules\psionics\equipment\psipower_tinker.dm"
#include "code\modules\psionics\equipment\psipower_tk.dm"
Expand Down
6 changes: 6 additions & 0 deletions code/_helpers/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,11 @@
/obj/item/material/hatchet/ishatchet()
return TRUE

/obj/item/psychic_power/psiblade/ishatchet()
return TRUE

/obj/item/psychic_power/psiaxe/ishatchet()
return TRUE

/obj/item/psychic_power/psifire/iswelder()
return TRUE
40 changes: 40 additions & 0 deletions code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,22 @@ About the new airlock wires panel:
src.lock_cut_state = BOLTS_EXPOSED
return 0

///PSIONICS///

else if(istype(item,/obj/item/psychic_power/psiaxe))
//special case - zero delay, different message
if (src.lock_cut_state == BOLTS_EXPOSED)
return 0 //can't actually cut the bolts, go back to regular smashing
user.visible_message(
"<span class='danger'>\The [user] smashes the bolt cover open!</span>",
"<span class='warning'>You smash the bolt cover open!</span>"
)
playsound(src, 'sound/weapons/smash.ogg', 100, 1)
src.lock_cut_state = BOLTS_EXPOSED
return 0

///PSIONICS///

else
// I guess you can't cut bolts with that item. Never mind then.
return 0
Expand Down Expand Up @@ -1150,6 +1166,30 @@ About the new airlock wires panel:
else
to_chat(user, "<span class='warning'>You need to be wielding \the [C] to do that.</span>")

///PSIONICS///

else if (istype(C, /obj/item/psychic_power/psiaxe) && !(stat & BROKEN) && user.a_intent == I_HURT)
var/obj/item/psychic_power/psiaxe/F = C
playsound(src, 'sound/weapons/smash.ogg', 100, 1)
health -= F.force * 2
if(health <= 0)
user.visible_message(SPAN_DANGER("[user] smashes \the [C] into the airlock's control panel! It explodes in a shower of sparks!"), SPAN_DANGER("You smash \the [C] into the airlock's control panel! It explodes in a shower of sparks!"))
health = 0
set_broken(TRUE)
else
user.visible_message(SPAN_DANGER("[user] smashes \the [C] into the airlock's control panel!"))

else if(istype(C, /obj/item/psychic_power/psiaxe) && !arePowerSystemsOn())
if(locked)
to_chat(user, "<span class='notice'>The airlock's bolts prevent it from being forced.</span>")
else if( !welded && !operating )
if(density)
spawn(0) open(1)
else
spawn(0) close(1)

///PSIONICS///

else if(istype(C, /obj/item/device/paint_sprayer))
return
else if((stat & (BROKEN|NOPOWER)) && istype(user, /mob/living/simple_animal) && !locked)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/doors/blast_door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
// This only works on broken doors or doors without power. Also allows repair with Plasteel.
/obj/machinery/door/blast/attackby(obj/item/C as obj, mob/user as mob)
add_fingerprint(user, 0, C)
if(isCrowbar(C) || (istype(C, /obj/item/material/twohanded/fireaxe) && C:wielded == 1))
if(isCrowbar(C) || (istype(C, /obj/item/material/twohanded/fireaxe) && C:wielded == 1) || istype(C,/obj/item/psychic_power/psiaxe))
if(((stat & NOPOWER) || (stat & BROKEN)) && !( operating ))
to_chat(user, "<span class='notice'>You begin prying at \the [src]...</span>")
if(do_after(user, 2 SECONDS, src))
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/doors/firedoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@
to_chat(user, SPAN_DANGER("\The [src] is welded shut!"))
return

if(isCrowbar(C) || istype(C,/obj/item/material/twohanded/fireaxe))
if(isCrowbar(C) || istype(C,/obj/item/material/twohanded/fireaxe) || istype(C,/obj/item/psychic_power/psiaxe))
if(operating)
return

Expand Down
5 changes: 3 additions & 2 deletions code/game/objects/structures/flora.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@
layer = ABOVE_HUMAN_LAYER

/obj/structure/flora/tree/attackby(obj/item/W, mob/user)
if( istype(W,/obj/item/material/hatchet) )
if( istype(W,/obj/item/material/hatchet) || istype(W,/obj/item/psychic_power/psiaxe) || istype(W,/obj/item/psychic_power/psiblade))
visible_message("<span class='notice'>\The [user] starts chopping \the [src]</span>")
if( do_after(user, 50) )
visible_message("<span class='notice'>\The [user] cutted \the [src]!</span>")
new /obj/item/stack/material/wood/ten(get_turf(src))
qdel(src)


/obj/structure/flora/tree/pine
name = "pine tree"
icon = 'icons/obj/flora/pinetrees.dmi'
icon_state = "pine_1"

/obj/structure/flora/tree/pine/attackby(obj/item/W, mob/user)
if( istype(W,/obj/item/material/hatchet) )
if( istype(W,/obj/item/material/hatchet) || istype(W,/obj/item/psychic_power/psiaxe) || istype(W,/obj/item/psychic_power/psiblade))
visible_message("<span class='notice'>\The [user] starts chopping \the [src] down...</span>")
if(do_after(user, 50) && anchored)
visible_message("<span class='notice'>\The [user] cutted \the [src]!</span>")
Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/structures/pit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,13 @@
message = "Here lies [nam], [born] - [died]."

/obj/structure/gravemarker/attackby(obj/item/W, mob/user)
if(istype(W,/obj/item/material/hatchet))
if(istype(W,/obj/item/material/hatchet) || istype(W,/obj/item/psychic_power/psiaxe) || istype(W,/obj/item/psychic_power/psiblade))
visible_message("<span class = 'warning'>\The [user] starts hacking away at \the [src] with \the [W].</span>")
if(!do_after(user, 30))
visible_message("<span class = 'warning'>\The [user] hacks \the [src] apart.</span>")
new /obj/item/stack/material/wood(src)
qdel(src)

if(istype(W,/obj/item/pen))
var/msg = sanitize(input(user, "What should it say?", "Grave marker", message) as text|null)
if(msg)
Expand Down
4 changes: 3 additions & 1 deletion code/modules/hydroponics/grown_inedible.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
var/list/allow_tool_types = list(
/obj/item/material/knife,
/obj/item/material/hatchet,
/obj/item/circular_saw
/obj/item/circular_saw,
/obj/item/psychic_power/psiaxe,
/obj/item/psychic_power/psiblade
)
var/carve_time = 5 SECONDS
var/result_type = null
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
if(prob(80))
src.visible_message("<span class='warning'>[src] absorbed all pure energy, sent into them!</span>")
src.psi.stamina = min(src.psi.max_stamina, src.psi.stamina + rand(15,20))
carried_orb.charge += 1

var/datum/effect/effect/system/spark_spread/l = new /datum/effect/effect/system/spark_spread
l.set_up(5, 1, loc)
Expand Down
15 changes: 14 additions & 1 deletion code/modules/psionics/equipment/psipower_blade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,20 @@
icon_state = "psiblade_long"
item_state = "psiblade_long"


/obj/item/psychic_power/psiaxe/afterattack(atom/A as mob|obj|turf|area, mob/user as mob, proximity)
if(!proximity) return

if(A)
if(istype(A,/obj/structure/window))
var/obj/structure/window/W = A
W.shatter()
else if(istype(A,/obj/structure/grille))
qdel(A)
else if(istype(A,/obj/effect/vine))
var/obj/effect/vine/P = A
P.die_off()

..()

/obj/item/psychic_power/psiaxe
name = "psychokinetic axe"
Expand Down
6 changes: 5 additions & 1 deletion code/modules/psionics/equipment/psipower_elements.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
icon_state = "electro"
item_state = "electro"
attack_cooldown = 5
var/charge = 0
var/cooldown = 0
var/ranged = FALSE

Expand Down Expand Up @@ -61,8 +62,10 @@
cooldown += 1
new /obj/effect/temporary(get_turf(user),3, 'icons/effects/effects.dmi', "electricity_constant")
return TRUE
target.electrocute_act(rand(el_rank * 2,el_rank * 5), user, 1, user.zone_sel.selecting)
target.electrocute_act(rand(el_rank + charge * 2,el_rank + charge * 5), user, 1, user.zone_sel.selecting)
cooldown += 1
if(charge >= 1)
charge -= 1
new /obj/effect/temporary(get_turf(target),3, 'icons/effects/effects.dmi', "electricity_constant")
return TRUE

Expand All @@ -86,6 +89,7 @@
to_chat(user, "<span class='warning'>Вы с скрипом разбиваете источник света, вытягивая всё электричество, которое в нём было.</span>")
lighting.broken(TRUE)
user.psi.stamina = min(user.psi.max_stamina, user.psi.stamina + rand(5,10))
charge += 1
else
return

Expand Down
103 changes: 103 additions & 0 deletions code/modules/psionics/equipment/psipower_gun.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/obj/item/gun/energy/psigun
name = "psychokinetic gun"
desc = "Result of Demiurgy and Hyloforia combinated factors."
icon = 'icons/obj/psychic_powers.dmi'
icon_state = "gun"
fire_sound = 'sound/weapons/Taser.ogg'
fire_sound_text = "energy blast"

var/maintain_cost = 10
var/mob/living/owner

max_shots = 20 //Determines the capacity of the weapon's power cell. Specifying a cell_type overrides this value.
projectile_type = /obj/item/projectile/psi

self_recharge = 1 //if set, the weapon will recharge itself

/obj/item/gun/energy/psigun/New(var/mob/living/_owner)
owner = _owner
if(!istype(owner))
qdel(src)
return
START_PROCESSING(SSprocessing, src)
..()

/obj/item/gun/energy/psigun/Destroy()
if(istype(owner) && owner.psi)
LAZYREMOVE(owner.psi.manifested_items, src)
UNSETEMPTY(owner.psi.manifested_items)
STOP_PROCESSING(SSprocessing, src)
. = ..()

/obj/item/gun/energy/psigun/get_storage_cost()
return ITEM_SIZE_NO_CONTAINER

/obj/item/gun/energy/psigun/attack(var/mob/living/M, var/mob/living/user, var/target_zone)
if(M.do_psionics_check(max(force, maintain_cost), user))
to_chat(user, "<span class='danger'>\The [src] flickers violently out of phase!</span>")
return 1
. = ..()

/obj/item/gun/energy/psigun/afterattack(var/atom/target, var/mob/living/user, var/proximity)
if(target.do_psionics_check(max(force, maintain_cost), user))
to_chat(user, "<span class='danger'>\The [src] flickers violently out of phase!</span>")
return
. = ..(target, user, proximity)

/obj/item/gun/energy/psigun/special_check(var/mob/user)

if(!istype(user, /mob/living))
return 0
if(!user.IsAdvancedToolUser())
return 0

var/mob/living/M = user
if(!safety() && world.time > last_safety_check + 5 MINUTES && !user.skill_check(SKILL_WEAPONS, SKILL_BASIC))
if(prob(30))
toggle_safety()
return 1
if(MUTATION_HULK in M.mutations)
to_chat(M, "<span class='danger'>Your fingers are much too large for the trigger guard!</span>")
return 0
if(M.psi)
var/hilo_rank = M.psi.get_rank(PSI_ENERGISTICS)
if(hilo_rank <= PSI_RANK_LATENT)
to_chat(M, "<span class='danger'>Àãà, òû íàó÷èëñÿ äåëàòü ïèñòîëåò! Òîëüêî êàê òû òåïåðü áóäåøü âûïóñêàòü èç íåãî ïóëè?</span>")
return 0
if((MUTATION_CLUMSY in M.mutations) && prob(40)) //Clumsy handling
var/obj/P = consume_next_projectile()
if(P)
if(process_projectile(P, user, user, pick(BP_L_FOOT, BP_R_FOOT)))
handle_post_fire(user, user)
user.visible_message(
"<span class='danger'>\The [user] shoots \himself in the foot with \the [src]!</span>",
"<span class='danger'>You shoot yourself in the foot with \the [src]!</span>"
)
M.unequip_item()
else
handle_click_empty(user)
return 0
return 1

/obj/item/gun/energy/psigun/dropped()
..()
qdel(src)

/obj/item/gun/energy/psigun/Process()
if(istype(owner))
owner.psi.spend_power(maintain_cost)
if(!owner || owner.do_psionics_check(maintain_cost, owner) || loc != owner || (owner.l_hand != src && owner.r_hand != src))
if(istype(loc,/mob/living))
var/mob/living/carbon/human/host = loc
if(istype(host))
for(var/obj/item/organ/external/organ in host.organs)
for(var/obj/item/O in organ.implants)
if(O == src)
organ.implants -= src
host.pinned -= src
host.embedded -= src
host.drop_from_inventory(src)
else
STOP_PROCESSING(SSprocessing, src)

..()
21 changes: 20 additions & 1 deletion code/modules/psionics/equipment/psipower_tinker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
icon_state = "tinker"
item_state = "psiblade"
force = 1
var/list/emulation = list("Crowbar","Wrench","Screwdriver","Wirecutters")
var/has_multitool = FALSE
var/has_welder = FALSE
var/emulating = "Crowbar"

/obj/item/psychic_power/tinker/iscrowbar()
Expand All @@ -64,12 +67,28 @@
/obj/item/psychic_power/tinker/iswirecutter()
return emulating == "Wirecutters"

/obj/item/psychic_power/tinker/ismultitool()
return emulating == "Multitool"

/obj/item/psychic_power/tinker/iswelder()
return emulating == "Welder"

/obj/item/psychic_power/tinker/attack_self()
if(owner.psi)
var/fire_rank = owner.psi.get_rank(PSI_METAKINESIS)
var/demi_rank = owner.psi.get_rank(PSI_MANIFESTATION)
if(fire_rank >= PSI_RANK_LATENT && demi_rank >= PSI_RANK_OPERANT && owner.skill_check(SKILL_CONSTRUCTION, SKILL_TRAINED) && !has_welder)
emulation += "Welder"
has_welder = TRUE
if(demi_rank >= PSI_RANK_MASTER && owner.skill_check(SKILL_ELECTRICAL, SKILL_BASIC) && owner.skill_check(SKILL_DEVICES, SKILL_TRAINED) && !has_multitool)
emulation += "Multitool"
has_multitool = TRUE


if(!owner || loc != owner)
return

var/choice = input("Select a tool to emulate.","Power") as null|anything in list("Crowbar","Wrench","Screwdriver","Wirecutters","Gloves","Dismiss")
var/choice = input("Select a tool to emulate.","Power") as null|anything in emulation
if(!choice)
return

Expand Down
2 changes: 1 addition & 1 deletion code/modules/psionics/faculties/consciousness.dm
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@
return TRUE

/decl/psionic_power/consciousness/curse
name = "Curse"
name = "Hallucinations"
cost = 20
cooldown = 50
use_grab = TRUE
Expand Down
14 changes: 10 additions & 4 deletions code/modules/psionics/faculties/manifestation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,36 @@
if(.)
switch(user.psi.get_rank(faculty))
if(PSI_RANK_GRANDMASTER)
var/option = input(target, "Choose something!", "Weapons to create") in list("Blade", "Club", "Battle Axe", "Spear", "Crossbow")
var/option = input(target, "Choose something!", "Weapons to create") in list("Sword", "Club", "Battle Axe", "Spear", "Crossbow", "Pistol")
if (!option)
return
if(user.psi.suppressed)
return
if(option == "Club")
return new /obj/item/psychic_power/psiclub/master/grand/paramount(user, user)
if(option == "Blade")
if(option == "Sword")
return new /obj/item/psychic_power/psiblade/master/grand/paramount(user, user)
if(option == "Battle Axe")
return new /obj/item/psychic_power/psiaxe/master/grand/paramount(user, user)
if(option == "Spear")
return new /obj/item/psychic_power/psispear/master/grand/paramount(user, user)
if(option == "Crossbow")
return new /obj/item/gun/launcher/crossbow/psibow/master/grand/paramount(user, user)
if(option == "Pistol")
if(user.skill_check(SKILL_WEAPONS, SKILL_TRAINED) && user.skill_check(SKILL_CONSTRUCTION, SKILL_EXPERIENCED))
return new /obj/item/gun/energy/psigun(user, user)
else
to_chat(user, SPAN_OCCULT("<b>Вы пытаетесь какое-то время собраться с мыслями, но совершенно не понимаете, как вам создать столь сложную конструкцию.</b>"))
return FALSE
if(PSI_RANK_MASTER)
var/option = input(target, "Choose something!", "Weapons to create") in list("Blade", "Club", "Battle Axe", "Spear", "Crossbow")
var/option = input(target, "Choose something!", "Weapons to create") in list("Sword", "Club", "Battle Axe", "Spear", "Crossbow")
if (!option)
return
if(user.psi.suppressed)
return
if(option == "Club")
return new /obj/item/psychic_power/psiclub/master/grand(user, user)
if(option == "Blade")
if(option == "Sword")
return new /obj/item/psychic_power/psiblade/master/grand(user, user)
if(option == "Battle Axe")
return new /obj/item/psychic_power/psiaxe/master(user, user)
Expand Down
Loading
Loading