Skip to content
This repository has been archived by the owner on Jan 22, 2020. It is now read-only.

Commit

Permalink
Merge pull request #729 from Zuhayr/psirewrite
Browse files Browse the repository at this point in the history
Broad psipower rewrite.
  • Loading branch information
MistakeNot4892 committed Jan 28, 2018
2 parents cf4df0a + 15ce732 commit 28d38fc
Show file tree
Hide file tree
Showing 69 changed files with 1,657 additions and 1,218 deletions.
7 changes: 4 additions & 3 deletions code/__defines/planes_layers.dm
Expand Up @@ -2,6 +2,7 @@
#define OPENTURF_BASE_LAYER TURF_LAYER-1
#define OPENTURF_MAX_LAYER TURF_LAYER-0.1

#define MASTER_PLANE 0
#define GUI_PLANE MASTER_PLANE + 50
#define DARK_PLANE MASTER_PLANE - 50
#define MASTER_PLANE 0
#define PSI_AURA_PLANE MASTER_PLANE + 10
#define GUI_PLANE MASTER_PLANE + 50
#define DARK_PLANE MASTER_PLANE - 50
4 changes: 0 additions & 4 deletions code/__defines/psychics.dm

This file was deleted.

1 change: 1 addition & 0 deletions code/__defines/subsystem-priority.dm
Expand Up @@ -33,6 +33,7 @@
#define SS_PRIORITY_OPENTURF 10 // Open turf icon generation/updates.

// SS_BACKGROUND
#define SS_PRIORITY_PSYCHICS 15 // Psychic complexus processing.
#define SS_PRIORITY_PROCESSING 15 // Generic datum processor. Replaces objects processor.
#define SS_PRIORITY_OBJECTS 15 // processing_objects processing.
#define SS_PRIORITY_WIRELESS 12 // Handles pairing of wireless devices. Usually will be asleep.
Expand Down
6 changes: 6 additions & 0 deletions code/_onclick/click.dm
Expand Up @@ -191,12 +191,18 @@
animals lunging, etc.
*/
/mob/proc/RangedAttack(var/atom/A, var/params)

if(!mutations.len) return

if((LASER in mutations) && a_intent == I_HURT)
LaserEyes(A) // moved into a proc below
return TRUE

else if(TK in mutations)
setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
A.attack_tk(src)
return TRUE

/*
Restrained ClickOn
Expand Down
10 changes: 8 additions & 2 deletions code/_onclick/hud/screen_objects.dm
Expand Up @@ -380,11 +380,17 @@
if("r_hand")
if(iscarbon(usr))
var/mob/living/carbon/C = usr
C.activate_hand("r")
if(C.hand)
C.swap_hand()
else
C.attack_empty_hand(BP_R_HAND)
if("l_hand")
if(iscarbon(usr))
var/mob/living/carbon/C = usr
C.activate_hand("l")
if(!C.hand)
C.swap_hand()
else
C.attack_empty_hand(BP_L_HAND)
if("swap")
usr:swap_hand()
if("hand")
Expand Down
11 changes: 8 additions & 3 deletions code/_onclick/other_mobs.dm
Expand Up @@ -32,14 +32,16 @@
return

/mob/living/carbon/human/RangedAttack(var/atom/A)
if(!gloves && !mutations.len) return

. = ..()
if(. || (!gloves && !mutations.len))
return

var/obj/item/clothing/gloves/G = gloves
if((LASER in mutations) && a_intent == I_HURT)
LaserEyes(A) // moved into a proc below

else if(istype(G) && G.Touch(A,0)) // for magic gloves
return

else if(TK in mutations)
A.attack_tk(src)

Expand Down Expand Up @@ -154,3 +156,6 @@
var/damage = rand(melee_damage_lower, melee_damage_upper)
if(A.attack_generic(src,damage,attacktext,environment_smash) && loc && attack_sound)
playsound(loc, attack_sound, 50, 1, 1)

/mob/proc/attack_empty_hand(var/bp_hand)
return
19 changes: 19 additions & 0 deletions code/controllers/subsystems/processing/psi.dm
@@ -0,0 +1,19 @@
var/datum/controller/subsystem/processing/psi/SSpsi

/datum/controller/subsystem/processing/psi
name = "Psychics"
priority = SS_PRIORITY_PSYCHICS
flags = SS_POST_FIRE_TIMING | SS_BACKGROUND | SS_NO_INIT
var/list/powers
var/list/psychics

/datum/controller/subsystem/processing/psi/New()
NEW_SS_GLOBAL(SSpsi)
LAZYINITLIST(psychics)
processing = psychics
powers = list()
for(var/ptype in subtypesof(/decl/psipower))
var/decl/psipower/power = ptype
if(initial(power.name))
power = new power
LAZYADD(powers[power.faculty], power)
4 changes: 4 additions & 0 deletions code/game/antagonist/outsider/paramount.dm
Expand Up @@ -19,6 +19,10 @@ var/datum/antagonist/paramount/paramounts
id_type = /obj/item/card/id/syndicate
faction = "paramount"

/datum/antagonist/paramount/New()
..()
paramounts = src

/datum/antagonist/paramount/create_id(var/assignment, var/mob/living/carbon/human/player, var/equip = 1)
var/obj/item/card/id/W = ..(assignment, player, equip = 0)
if(!W) return
Expand Down
1 change: 1 addition & 0 deletions code/game/atoms_movable_init.dm
Expand Up @@ -63,6 +63,7 @@
/obj/effect/lobby_image/auto_init = 1
/obj/effect/blob/auto_init = 1
/obj/effect/shuttle_landmark/auto_init = 0
/obj/effect/psi_aura/auto_init = 1

/obj/machinery/auto_init = 1

Expand Down
9 changes: 4 additions & 5 deletions code/game/objects/items/weapons/melee/energy.dm
Expand Up @@ -185,16 +185,15 @@
var/mob/living/creator
var/datum/effect/system/spark_spread/spark_system

/obj/item/melee/energy/blade/New()

/obj/item/melee/energy/blade/New(var/newloc, var/mob/_creator)
creator = _creator
spark_system = new /datum/effect/system/spark_spread()
spark_system.set_up(5, 0, src)
spark_system.attach(src)

processing_objects |= src
START_PROCESSING(SSprocessing, src)

/obj/item/melee/energy/blade/Destroy()
processing_objects -= src
STOP_PROCESSING(SSprocessing, src)
return ..()

/obj/item/melee/energy/blade/get_storage_cost()
Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/structures/girders.dm
Expand Up @@ -69,7 +69,7 @@
user << "<span class='notice'>You secured the girder!</span>"
reset_girder()

else if(istype(W, /obj/item/pickaxe/plasmacutter) || istype(W, /obj/item/psychic_power/kinesis/paramount))
else if(istype(W, /obj/item/pickaxe/plasmacutter) || istype(W, /obj/item/psychic_power/psiblade/master/grand/paramount))
user << "<span class='notice'>Now slicing apart the girder...</span>"
if(do_after(user,30,src))
if(!src) return
Expand All @@ -93,7 +93,7 @@
reinforcing = !reinforcing
user << "<span class='notice'>\The [src] can now be [reinforcing? "reinforced" : "constructed"]!</span>"

else if((W.iswirecutter() || istype(W, /obj/item/psychic_power/kinesis)) && state == 1)
else if((W.iswirecutter() || istype(W,/obj/item/psychic_power/psiblade/master)) && state == 1)
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
user << "<span class='notice'>Now removing support struts...</span>"
if(do_after(user, 40,src))
Expand Down Expand Up @@ -238,7 +238,7 @@
user << "<span class='notice'>You dissasembled the girder!</span>"
dismantle()

else if(istype(W, /obj/item/pickaxe/plasmacutter) || istype(W, /obj/item/psychic_power/kinesis/paramount))
else if(istype(W, /obj/item/pickaxe/plasmacutter) || istype(W, /obj/item/psychic_power/psiblade/master/grand/paramount))
user << "<span class='notice'>Now slicing apart the girder...</span>"
if(do_after(user,30,src))
user << "<span class='notice'>You slice apart the girder!</span>"
Expand Down
13 changes: 6 additions & 7 deletions code/game/turfs/simulated/wall_attacks.dm
Expand Up @@ -180,7 +180,7 @@
dismantle_verb = "cutting"
dismantle_sound = 'sound/items/Welder.ogg'
cut_delay *= 0.7
else if(istype(W,/obj/item/melee/energy/blade) || istype(W,/obj/item/psychic_power/kinesis))
else if(istype(W,/obj/item/melee/energy/blade) || istype(W,/obj/item/psychic_power/psiblade/master))
dismantle_sound = "sparks"
dismantle_verb = "slicing"
cut_delay *= 0.5
Expand Down Expand Up @@ -211,10 +211,9 @@
else
switch(construction_stage)
if(6)
if(istype(W, /obj/item/psychic_power/psiblade/master/grand/paramount))

if(istype(W, /obj/item/psychic_power/kinesis/paramount))

user << "<span class='notice'>You sink your hands into the wall and begin trying to rip out the support frame...</span>"
user << "<span class='notice'>You sink \the [W] into the wall and begin trying to rip out the support frame...</span>"
playsound(src, 'sound/items/Welder.ogg', 100, 1)

if(!do_after(user, 60, src))
Expand All @@ -225,7 +224,7 @@
user.visible_message("<span class='warning'>The wall was torn open by [user]!</span>")
playsound(src, 'sound/items/Welder.ogg', 100, 1)

else if (W.iswirecutter() || istype(W, /obj/item/psychic_power/kinesis))
else if (W.iswirecutter() || istype(W, /obj/item/psychic_power/psiblade/master))
playsound(src, 'sound/items/Wirecutter.ogg', 100, 1)
construction_stage = 5
new /obj/item/stack/rods( src )
Expand Down Expand Up @@ -261,7 +260,7 @@
else
user << "<span class='notice'>You need more welding fuel to complete this task.</span>"
return
else if (istype(W, /obj/item/pickaxe/plasmacutter) || istype(W, /obj/item/psychic_power/kinesis))
else if (istype(W, /obj/item/pickaxe/plasmacutter) || istype(W, /obj/item/psychic_power/psiblade/master))
cut_cover = 1
if(cut_cover)
user << "<span class='notice'>You begin slicing through the metal cover.</span>"
Expand Down Expand Up @@ -301,7 +300,7 @@
else
user << "<span class='notice'>You need more welding fuel to complete this task.</span>"
return
else if(istype(W, /obj/item/pickaxe/plasmacutter) || istype(W, /obj/item/psychic_power/kinesis))
else if(istype(W, /obj/item/pickaxe/plasmacutter) || istype(W,/obj/item/psychic_power/psiblade/master))
cut_cover = 1
if(cut_cover)
user << "<span class='notice'>You begin slicing through the support rods.</span>"
Expand Down
1 change: 1 addition & 0 deletions code/modules/aspects/aspects.dm
Expand Up @@ -134,3 +134,4 @@
var/decl/aspect/A = aspects_by_name[aspect]
if(istype(A))
A.do_post_spawn(src)
if(psi) psi.update() // In case of psi aspects, which defer the update to avoid spamming it 20 times in a row.
59 changes: 26 additions & 33 deletions code/modules/aspects/aspects_psychic.dm
Expand Up @@ -7,128 +7,121 @@
var/assoc_rank = 0

/decl/aspect/psi/do_post_spawn(var/mob/living/carbon/human/holder)
if(!istype(holder))
return
if(assoc_faculty && assoc_rank && holder.mind)
var/datum/psychic_power_assay/assay = holder.mind.psychic_faculties[assoc_faculty]
if(!assay)
assay = new(holder.mind, all_psychic_faculties[assoc_faculty])
holder.mind.psychic_faculties[assoc_faculty] = assay
if(assoc_rank > assay.rank)
assay.set_rank(assoc_rank, silent=1)
if(assoc_faculty && assoc_rank && istype(holder))
holder.set_psi_rank(assoc_faculty, assoc_rank, take_larger = TRUE, defer_update = TRUE)

// COERCIVE
/decl/aspect/psi/coercion
name = ASPECT_PSI_COERCION_L
desc = "You possess latent coercive powers."
parent_name = ASPECT_PSI_ROOT
assoc_faculty = PSYCHIC_COERCION
assoc_rank = 1
parent_name = ASPECT_PSI_ROOT
assoc_faculty = PSI_COERCION
assoc_rank = PSI_RANK_LATENT

/decl/aspect/psi/coercion/operant
name = ASPECT_PSI_COERCION_O
desc = "Your coercive faculty is fully awakened."
parent_name = ASPECT_PSI_COERCION_L
assoc_rank = 2
assoc_rank = PSI_RANK_OPERANT
aspect_cost = 2

/decl/aspect/psi/coercion/master
name = ASPECT_PSI_COERCION_MC
desc = "You have trained extensively in mastering your coercive faculty."
parent_name = ASPECT_PSI_COERCION_O
assoc_rank = 3
assoc_rank = PSI_RANK_MASTER
aspect_cost = 2

/decl/aspect/psi/coercion/grandmaster
name = ASPECT_PSI_COERCION_GMC
desc = "You are a recognised and gifted grand master of the coercive faculty."
parent_name = ASPECT_PSI_COERCION_MC
assoc_rank = 4
assoc_rank = PSI_RANK_GRANDMASTER
aspect_cost = 3

// CREATIVE
/decl/aspect/psi/creative
name = ASPECT_PSI_CREATIVE_L
desc = "You possess latent energistic powers."
parent_name = ASPECT_PSI_ROOT
assoc_faculty = PSYCHIC_CREATIVITY
assoc_rank = 1
parent_name = ASPECT_PSI_ROOT
assoc_faculty = PSI_ENERGISTICS
assoc_rank = PSI_RANK_LATENT

/decl/aspect/psi/creative/operant
name = ASPECT_PSI_CREATIVE_O
desc = "Your energistic faculty is fully awakened."
parent_name = ASPECT_PSI_CREATIVE_L
assoc_rank = 2
assoc_rank = PSI_RANK_OPERANT
aspect_cost = 2

/decl/aspect/psi/creative/master
name = ASPECT_PSI_CREATIVE_MC
desc = "You have trained extensively in mastering your energistic faculty."
parent_name = ASPECT_PSI_CREATIVE_O
assoc_rank = 3
assoc_rank = PSI_RANK_MASTER
aspect_cost = 2

/decl/aspect/psi/creative/grandmaster
name = ASPECT_PSI_CREATIVE_GMC
desc = "You are a recognised and gifted grand master of the energistic faculty."
parent_name = ASPECT_PSI_CREATIVE_MC
assoc_rank = 4
assoc_rank = PSI_RANK_GRANDMASTER
aspect_cost = 3

// PSYCHOKINETIC
/decl/aspect/psi/psychokinesis
name = ASPECT_PSI_PKINESIS_L
desc = "You possess latent psychokinetic powers."
parent_name = ASPECT_PSI_ROOT
assoc_faculty = PSYCHIC_PSYCHOKINESIS
assoc_rank = 1
parent_name = ASPECT_PSI_ROOT
assoc_faculty = PSI_PSYCHOKINESIS
assoc_rank = PSI_RANK_LATENT

/decl/aspect/psi/psychokinesis/operant
name = ASPECT_PSI_PKINESIS_O
desc = "Your psychokinetic faculty is fully awakened."
parent_name = ASPECT_PSI_PKINESIS_L
assoc_rank = 2
assoc_rank = PSI_RANK_OPERANT
aspect_cost = 2

/decl/aspect/psi/psychokinesis/master
name = ASPECT_PSI_PKINESIS_MC
desc = "You have trained extensively in mastering your psychokinetic faculty."
parent_name = ASPECT_PSI_PKINESIS_O
assoc_rank = 3
assoc_rank = PSI_RANK_MASTER
aspect_cost = 2

/decl/aspect/psi/psychokinesis/grandmaster
name = ASPECT_PSI_PKINESIS_GMC
desc = "You are a recognised and gifted grand master of the psychokinetic faculty."
parent_name = ASPECT_PSI_PKINESIS_MC
assoc_rank = 4
assoc_rank = PSI_RANK_GRANDMASTER
aspect_cost = 3

// REDACTIVE
/decl/aspect/psi/redaction
name = ASPECT_PSI_REDACTOR_L
desc = "You possess latent biokinetic powers."
parent_name = ASPECT_PSI_ROOT
assoc_faculty = PSYCHIC_REDACTION
assoc_rank = 1
parent_name = ASPECT_PSI_ROOT
assoc_faculty = PSI_REDACTION
assoc_rank = PSI_RANK_LATENT

/decl/aspect/psi/redaction/operant
name = ASPECT_PSI_REDACTOR_O
desc = "Your biokinetic faculty is fully awakened."
parent_name = ASPECT_PSI_REDACTOR_L
assoc_rank = 2
assoc_rank = PSI_RANK_OPERANT
aspect_cost = 2

/decl/aspect/psi/redaction/master
name = ASPECT_PSI_REDACTOR_MC
desc = "You have trained extensively in mastering your biokinetic faculty."
parent_name = ASPECT_PSI_REDACTOR_O
assoc_rank = 3
assoc_rank = PSI_RANK_MASTER
aspect_cost = 2

/decl/aspect/psi/redaction/grandmaster
name = ASPECT_PSI_REDACTOR_GMC
desc = "You are a recognised and gifted grand master of the biokinetic faculty."
parent_name = ASPECT_PSI_REDACTOR_MC
assoc_rank = 4
assoc_rank = PSI_RANK_GRANDMASTER
aspect_cost = 3
3 changes: 1 addition & 2 deletions code/modules/clothing/spacesuits/rig/modules/combat.dm
Expand Up @@ -130,8 +130,7 @@
deactivate()
return

var/obj/item/melee/energy/blade/blade = new(M)
blade.creator = M
var/obj/item/melee/energy/blade/blade = new(M, M)
M.put_in_hands(blade)

/obj/item/rig_module/energy_blade/deactivate()
Expand Down
Empty file.

0 comments on commit 28d38fc

Please sign in to comment.