Moves projectile processing to a subsystem

This commit is contained in:
kevinz000
2017-10-15 21:51:24 -05:00
committed by CitadelStationBot
parent be2dc49384
commit ed96224d3a
31 changed files with 486 additions and 333 deletions
+3 -8
View File
@@ -385,13 +385,11 @@
Laser Eyes: as the name implies, handles this since nothing else does currently
face_atom: turns the mob towards what you clicked on
*/
/mob/proc/LaserEyes(atom/A)
/mob/proc/LaserEyes(atom/A, params)
return
/mob/living/LaserEyes(atom/A)
/mob/living/LaserEyes(atom/A, params)
changeNext_move(CLICK_CD_RANGE)
var/turf/T = get_turf(src)
var/turf/U = get_turf(A)
var/obj/item/projectile/beam/LE = new /obj/item/projectile/beam( loc )
LE.icon = 'icons/effects/genetics.dmi'
@@ -400,10 +398,7 @@
LE.firer = src
LE.def_zone = get_organ_target()
LE.original = A
LE.current = T
LE.yo = U.y - T.y
LE.xo = U.x - T.x
LE.preparePixelProjectile(A, src, params)
LE.fire()
// Simple helper to face what you clicked on, in case it should be needed in more than one place
+105
View File
@@ -1,3 +1,4 @@
<<<<<<< HEAD
/*
Humans:
Adds an exception for gloves, to allow special glove types like the ninja ones.
@@ -100,6 +101,110 @@
"<span class='userdanger'>[name] bites [ML]!</span>")
if(armor >= 2)
return
=======
/*
Humans:
Adds an exception for gloves, to allow special glove types like the ninja ones.
Otherwise pretty standard.
*/
/mob/living/carbon/human/UnarmedAttack(atom/A, proximity)
if(!has_active_hand()) //can't attack without a hand.
to_chat(src, "<span class='notice'>You look at your arm and sigh.</span>")
return
// Special glove functions:
// If the gloves do anything, have them return 1 to stop
// normal attack_hand() here.
var/obj/item/clothing/gloves/G = gloves // not typecast specifically enough in defines
if(proximity && istype(G) && G.Touch(A,1))
return
var/override = 0
for(var/datum/mutation/human/HM in dna.mutations)
override += HM.on_attack_hand(src, A, proximity)
if(override)
return
A.attack_hand(src)
/atom/proc/attack_hand(mob/user)
return
/atom/proc/interact(mob/user)
return
/*
/mob/living/carbon/human/RestrainedClickOn(var/atom/A) ---carbons will handle this
return
*/
/mob/living/carbon/RestrainedClickOn(atom/A)
return 0
/mob/living/carbon/human/RangedAttack(atom/A, mouseparams)
if(gloves)
var/obj/item/clothing/gloves/G = gloves
if(istype(G) && G.Touch(A,0)) // for magic gloves
return
for(var/datum/mutation/human/HM in dna.mutations)
HM.on_ranged_attack(src, A, mouseparams)
if(isturf(A) && get_dist(src,A) <= 1)
src.Move_Pulled(A)
/*
Animals & All Unspecified
*/
/mob/living/UnarmedAttack(atom/A)
A.attack_animal(src)
/atom/proc/attack_animal(mob/user)
return
/mob/living/RestrainedClickOn(atom/A)
return
/*
Monkeys
*/
/mob/living/carbon/monkey/UnarmedAttack(atom/A)
A.attack_paw(src)
/atom/proc/attack_paw(mob/user)
return
/*
Monkey RestrainedClickOn() was apparently the
one and only use of all of the restrained click code
(except to stop you from doing things while handcuffed);
moving it here instead of various hand_p's has simplified
things considerably
*/
/mob/living/carbon/monkey/RestrainedClickOn(atom/A)
if(..())
return
if(a_intent != INTENT_HARM || !ismob(A))
return
if(is_muzzled())
return
var/mob/living/carbon/ML = A
if(istype(ML))
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
var/obj/item/bodypart/affecting = null
if(ishuman(ML))
var/mob/living/carbon/human/H = ML
affecting = H.get_bodypart(ran_zone(dam_zone))
var/armor = ML.run_armor_check(affecting, "melee")
if(prob(75))
ML.apply_damage(rand(1,3), BRUTE, affecting, armor)
ML.visible_message("<span class='danger'>[name] bites [ML]!</span>", \
"<span class='userdanger'>[name] bites [ML]!</span>")
if(armor >= 2)
return
>>>>>>> 64851d8... Moves projectile processing to a subsystem (#30599)
for(var/thing in viruses)
var/datum/disease/D = thing
ML.ForceContractDisease(D)