Merges AI Branch into Master

This commit is contained in:
Atermonera
2018-12-01 00:06:38 -05:00
committed by VirgoBot
parent 15017e893e
commit 2df5e9fe0e
379 changed files with 22460 additions and 4751 deletions
+3 -2
View File
@@ -173,7 +173,7 @@
if(!user.IsAdvancedToolUser())
return 0
if(isanimal(user))
var/mob/living/simple_animal/S = user
var/mob/living/simple_mob/S = user
if(!S.IsHumanoidToolUser(src))
return 0
@@ -526,7 +526,8 @@
return 2
//just assume we can shoot through glass and stuff. No big deal, the player can just choose to not target someone
//on the other side of a window if it makes a difference. Or if they run behind a window, too bad.
return check_trajectory(target, user)
if(check_trajectory(target, user))
return 1 // Magic numbers are fun.
//called if there was no projectile to shoot
/obj/item/weapon/gun/proc/handle_click_empty(mob/user)
@@ -155,13 +155,13 @@
else
src.visible_message("*fizzle*")
playsound(src.loc, 'sound/effects/sparks1.ogg', 100, 1)
/*
/obj/item/weapon/gun/energy/staff/animate
name = "staff of animation"
desc = "An artifact that spits bolts of life force, which causes objects which are hit by it to animate and come to life! This magic doesn't affect machines."
projectile_type = /obj/item/projectile/animate
charge_cost = 240
*/
obj/item/weapon/gun/energy/staff/focus
name = "mental focus"
desc = "An artifact that channels the will of the user into destructive bolts of force. If you aren't careful with it, you might poke someone's brain out."
+12 -3
View File
@@ -59,6 +59,8 @@
var/drowsy = 0
var/agony = 0
var/reflected = 0 // This should be set to 1 if reflected by any means, to prevent infinite reflections.
var/modifier_type_to_apply = null // If set, will apply a modifier to mobs that are hit by this projectile.
var/modifier_duration = null // How long the above modifier should last for. Leave null to be permanent.
embed_chance = 0 //Base chance for a projectile to embed
@@ -86,6 +88,8 @@
// if(isanimal(target)) return 0
var/mob/living/L = target
L.apply_effects(stun, weaken, paralyze, irradiate, stutter, eyeblur, drowsy, agony, blocked, incendiary, flammability) // add in AGONY!
if(modifier_type_to_apply)
L.add_modifier(modifier_type_to_apply, modifier_duration)
return 1
//called when the projectile stops flying because it collided with something
@@ -421,6 +425,7 @@
yo = null
xo = null
var/result = 0 //To pass the message back to the gun.
var/atom/movable/result_ref = null // The thing that got hit that made the check return true.
/obj/item/projectile/test/Bump(atom/A as mob|obj|turf|area)
if(A == firer)
@@ -439,6 +444,7 @@
if(!S.anchored)
return
if(istype(A, /mob/living) || istype(A, /obj/mecha) || istype(A, /obj/vehicle))
result_ref = A
result = 2 //We hit someone, return 1!
return
result = 1
@@ -459,7 +465,8 @@
/obj/item/projectile/test/process(var/turf/targloc)
while(src) //Loop on through!
if(result)
return (result - 1)
return result_ref
// return (result - 1)
if((!( targloc ) || loc == targloc))
targloc = locate(min(max(x + xo, 1), world.maxx), min(max(y + yo, 1), world.maxy), z) //Finding the target turf at map edge
@@ -470,11 +477,13 @@
var/mob/living/M = locate() in get_turf(src)
if(istype(M)) //If there is someting living...
return 1 //Return 1
result_ref = M
return result_ref //Return 1
else
M = locate() in get_step(src,targloc)
if(istype(M))
return 1
result_ref = M
return result_ref
//Helper proc to check if you can hit them or not.
/proc/check_trajectory(atom/target as mob|obj, atom/firer as mob|obj, var/pass_flags=PASSTABLE|PASSGLASS|PASSGRILLE, flags=null)
@@ -54,7 +54,7 @@
Robot.mmi = new /obj/item/device/mmi(new_mob)
Robot.mmi.transfer_identity(M) //Does not transfer key/client.
if("slime")
new_mob = new /mob/living/simple_animal/slime(M.loc)
new_mob = new /mob/living/simple_mob/slime/xenobio(M.loc)
new_mob.universal_speak = 1
else
var/mob/living/carbon/human/H