Ports a psionic system from Bay. (#7717)

* Ports a psionic system from Bay.

* Rip out this shitcode.

* shitcoden't

* fixes

* it should work fully now

* Admin fixes

* Remove todos

* remove todos part 2

* Removes psi-armour. We don't need this for now.

* Skrell are now operants. Tweaks coercion.

* Adds thralls.

* Temp removal of psiarmour. Fixes psigrabs.

* Thrall assay.

* fixes

* More fixes

* unused define cleanup

* Log and powers

* Skrell powers are done.

* Update code/modules/psionics/events/mini_spasm.dm

Co-Authored-By: Geeves <ggrobler447@gmail.com>

* Update code/modules/psionics/events/mini_spasm.dm

Co-Authored-By: Geeves <ggrobler447@gmail.com>

* Update code/modules/psionics/equipment/cerebro_enhancers.dm

* did this work???

* jargon

* arrow's fixes

Co-authored-by: Geeves <ggrobler447@gmail.com>
This commit is contained in:
Matt Atlas
2019-12-24 11:32:05 +01:00
committed by Werner
parent 6fe1c9c3b4
commit c087a0a0bf
94 changed files with 2284 additions and 413 deletions

View File

@@ -211,17 +211,7 @@
if(!mutations.len) return
if((LASER_EYES in mutations) && a_intent == I_HURT)
LaserEyes(A, params) // moved into a proc below
else if(TK in mutations)
switch(get_dist(src,A))
if(1 to 5) // not adjacent may mean blocked by window
setMoveCooldown(2)
if(5 to 7)
setMoveCooldown(5)
if(8 to tk_maxrange)
setMoveCooldown(10)
else
return
A.attack_tk(src)
/*
Restrained ClickOn

View File

@@ -29,24 +29,23 @@
/atom/proc/attack_hand(mob/user as mob)
return
/mob/proc/attack_empty_hand(var/bp_hand)
return
/mob/living/carbon/human/RestrainedClickOn(var/atom/A)
return
/mob/living/carbon/human/RangedAttack(var/atom/A)
if(!(gloves || mutations.len || glasses)) return
var/obj/item/clothing/gloves/GV = gloves
var/obj/item/clothing/glasses/GS = glasses
if((LASER_EYES in mutations) && a_intent == I_HURT)
LaserEyes(A) // moved into a proc below
else if(istype(GS) && GS.Look(A,src,0)) // for goggles
if(istype(GS) && GS.Look(A,src,0)) // for goggles
return
else if(istype(GV) && GV.Touch(A,src,0)) // for magic gloves
if(istype(GV) && GV.Touch(A,src,0)) // for magic gloves
return
else if(TK in mutations)
A.attack_tk(src)
. = ..()
/mob/living/RestrainedClickOn(var/atom/A)
return

View File

@@ -1,180 +0,0 @@
/*
Telekinesis
This needs more thinking out, but I might as well.
*/
var/const/tk_maxrange = 15
/*
Telekinetic attack:
By default, emulate the user's unarmed attack
*/
/atom/proc/attack_tk(mob/user)
if(user.stat) return
user.UnarmedAttack(src,0) // attack_hand, attack_paw, etc
return
/*
This is similar to item attack_self, but applies to anything
that you can grab with a telekinetic grab.
It is used for manipulating things at range, for example, opening and closing closets.
There are not a lot of defaults at this time, add more where appropriate.
*/
/atom/proc/attack_self_tk(mob/user)
return
/obj/attack_tk(mob/user)
if(user.stat) return
if(anchored)
..()
return
var/obj/item/tk_grab/O = new(src)
user.put_in_active_hand(O)
O.host = user
O.focus_object(src)
return
/obj/item/attack_tk(mob/user)
if(user.stat || !isturf(loc)) return
if((TK in user.mutations) && !user.get_active_hand()) // both should already be true to get here
var/obj/item/tk_grab/O = new(src)
user.put_in_active_hand(O)
O.host = user
O.focus_object(src)
else
warning("Strange attack_tk(): TK([TK in user.mutations]) empty hand([!user.get_active_hand()])")
return
/mob/attack_tk(mob/user)
return // needs more thinking about
/*
TK Grab Item (the workhorse of old TK)
* If you have not grabbed something, do a normal tk attack
* If you have something, throw it at the target. If it is already adjacent, do a normal attackby()
* If you click what you are holding, or attack_self(), do an attack_self_tk() on it.
* Deletes itself if it is ever not in your hand, or if you should have no access to TK.
*/
/obj/item/tk_grab
name = "Telekinetic Grab"
desc = "Magic"
icon = 'icons/obj/magic.dmi'//Needs sprites
icon_state = "2"
flags = NOBLUDGEON
//item_state = null
w_class = 10.0
layer = SCREEN_LAYER
var/last_throw = 0
var/atom/movable/focus = null
var/mob/living/host = null
/obj/item/tk_grab/Destroy()
if (host)
host.remove_from_mob(src)
host = null
focus = null
return ..()
/obj/item/tk_grab/dropped(mob/user as mob)
if(focus && user && loc != user && loc != user.loc) // drop_item() gets called when you tk-attack a table/closet with an item
if(focus.Adjacent(loc))
focus.forceMove(loc)
loc = null
QDEL_IN(src, 1)
return
//stops TK grabs being equipped anywhere but into hands
/obj/item/tk_grab/equipped(var/mob/user, var/slot)
if( (slot == slot_l_hand) || (slot== slot_r_hand) ) return
qdel(src)
return
/obj/item/tk_grab/attack_self(mob/user as mob)
if(focus)
focus.attack_self_tk(user)
/obj/item/tk_grab/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, proximity)//TODO: go over this
if(!target || !user) return
if(last_throw+3 > world.time) return
if(!host || host != user)
qdel(src)
return
if(!(TK in host.mutations))
qdel(src)
return
if(isobj(target) && !isturf(target.loc))
return
var/d = get_dist(user, target)
if(focus) d = max(d,get_dist(user,focus)) // whichever is further
switch(d)
if(0)
;
if(1 to 5) // not adjacent may mean blocked by window
if(!proximity)
user.setMoveCooldown(2)
if(5 to 7)
user.setMoveCooldown(5)
if(8 to tk_maxrange)
user.setMoveCooldown(10)
else
to_chat(user, "<span class='notice'>Your mind won't reach that far.</span>")
return
if(!focus)
focus_object(target, user)
return
if(target == focus)
target.attack_self_tk(user)
return // todo: something like attack_self not laden with assumptions inherent to attack_self
if(!istype(target, /turf) && istype(focus,/obj/item) && target.Adjacent(focus))
var/obj/item/I = focus
var/resolved = target.attackby(I, user, user:get_organ_target())
if(!resolved && target && I)
I.afterattack(target,user,1) // for splashing with beakers
else
apply_focus_overlay()
focus.throw_at(target, 10, 1, user)
last_throw = world.time
return
/obj/item/tk_grab/attack(mob/living/M as mob, mob/living/user as mob, def_zone)
return
/obj/item/tk_grab/proc/focus_object(var/obj/target, var/mob/living/user)
if(!istype(target,/obj)) return//Cant throw non objects atm might let it do mobs later
if(target.anchored || !isturf(target.loc))
qdel(src)
return
focus = target
update_icon()
apply_focus_overlay()
return
/obj/item/tk_grab/proc/apply_focus_overlay()
if(!focus) return
var/obj/effect/overlay/O = new(locate(focus.x,focus.y,focus.z))
O.name = "sparkles"
O.anchored = 1
O.density = 0
O.layer = FLY_LAYER
O.set_dir(pick(cardinal))
O.icon = 'icons/effects/effects.dmi'
O.icon_state = "nothing"
flick("empdisable",O)
QDEL_IN(O, 5)
/obj/item/tk_grab/update_icon()
cut_overlays()
if(focus && focus.icon && focus.icon_state)
add_overlay(image(focus.icon, focus.icon_state))