Deathwands and googly eyes (#4653)

This commit is contained in:
TheDZD
2016-06-13 23:07:13 -04:00
committed by Fox McCloud
parent 3d18c438e9
commit cc2766e7d7
6 changed files with 109 additions and 53 deletions
@@ -260,21 +260,23 @@
if(target == start)
return
var/obj/item/projectile/A = new projectiletype(src.loc)
playsound(user, projectilesound, 100, 1)
if(!A)
return
A.current = target
A.firer = src
A.yo = target:y - start:y
A.xo = target:x - start:x
if(AIStatus == AI_OFF)//Don't want mindless mobs to have their movement screwed up firing in space
newtonian_move(get_dir(target, user))
A.original = target
spawn( 0 )
if(casingtype)
var/obj/item/ammo_casing/casing = new casingtype
playsound(src, projectilesound, 100, 1)
casing.fire(target, src, zone_override = ran_zone())
casing.loc = loc
else
var/obj/item/projectile/A = new projectiletype(loc)
playsound(user, projectilesound, 100, 1)
A.current = target
A.firer = src
A.yo = target:y - start:y
A.xo = target:x - start:x
if(AIStatus == AI_OFF)//Don't want mindless mobs to have their movement screwed up firing in space
newtonian_move(get_dir(target, user))
A.original = target
A.fire()
return
return A
/mob/living/simple_animal/hostile/proc/DestroySurroundings()
if(environment_smash)
@@ -1,7 +1,3 @@
//
// Abstract Class
//
/mob/living/simple_animal/hostile/mimic
name = "crate"
desc = "A rectangular steel crate."
@@ -39,7 +35,7 @@
/mob/living/simple_animal/hostile/mimic/death()
..()
visible_message("\red <b>[src]</b> stops moving!")
visible_message("<span class='danger'>[src]</b> stops moving!</span>")
ghostize()
qdel(src)
@@ -52,16 +48,9 @@
adjustBruteLoss(50)
..(severity)
//
// Crate Mimic
//
// Aggro when you try to open them. Will also pickup loot when spawns and drop it when dies.
/mob/living/simple_animal/hostile/mimic/crate
attacktext = "bites"
stop_automated_movement = 1
wander = 0
var/attempt_open = 0
@@ -112,7 +101,6 @@
icon_state = initial(icon_state)
/mob/living/simple_animal/hostile/mimic/crate/death()
var/obj/structure/closet/crate/C = new(get_turf(src))
// Put loot in crate
for(var/obj/O in src)
@@ -127,22 +115,18 @@
L.Weaken(2)
L.visible_message("<span class='danger'>\the [src] knocks down \the [L]!</span>")
//
// Copy Mimic
//
var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/cable, /obj/structure/window, /obj/item/projectile/magic/animate)
var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/cable, /obj/structure/window)
/mob/living/simple_animal/hostile/mimic/copy
health = 100
maxHealth = 100
var/mob/living/creator = null // the creator
var/destroy_objects = 0
var/knockdown_people = 0
var/image/googly_eyes = null
gold_core_spawnable = CHEM_MOB_SPAWN_INVALID
/mob/living/simple_animal/hostile/mimic/copy/New(loc, var/obj/copy, var/mob/living/creator, var/destroy_original = 0)
/mob/living/simple_animal/hostile/mimic/copy/New(loc, obj/copy, mob/living/creator, destroy_original = 0)
..(loc)
CopyObject(copy, creator, destroy_original)
@@ -158,7 +142,6 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca
..()
/mob/living/simple_animal/hostile/mimic/copy/ListTargets()
// Return a list of targets that isn't the creator
. = ..()
return . - creator
@@ -173,10 +156,8 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca
return 1
return 0
/mob/living/simple_animal/hostile/mimic/copy/proc/CopyObject(var/obj/O, var/mob/living/creator, var/destroy_original = 0)
/mob/living/simple_animal/hostile/mimic/copy/proc/CopyObject(var/obj/O, var/mob/living/user, var/destroy_original = 0)
if(destroy_original || CheckObject(O))
O.loc = src
name = O.name
desc = O.desc
@@ -184,7 +165,8 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca
icon_state = O.icon_state
icon_living = icon_state
overlays = O.overlays
googly_eyes = image('icons/mob/mob.dmi',"googly_eyes")
overlays += googly_eyes
if(istype(O, /obj/structure) || istype(O, /obj/machinery))
health = (anchored * 50) + 50
destroy_objects = 1
@@ -202,10 +184,9 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca
move_to_delay = 2 * I.w_class + 1
if(istype(O, /obj/item/device))
is_electronic = 1
maxHealth = health
if(creator)
src.creator = creator
if(user)
creator = user
faction += "\ref[creator]" // very unique
if(destroy_original)
qdel(O)
@@ -226,9 +207,9 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca
C.visible_message("<span class='danger'>\The [src] knocks down \the [C]!</span>", \
"<span class='userdanger'>\The [src] knocks you down!</span>")
//
// Machine Mimics (Made by Malf AI)
//
/mob/living/simple_animal/hostile/mimic/copy/Aggro()
..()
googly_eyes.dir = get_dir(src,target)
/mob/living/simple_animal/hostile/mimic/copy/machine
speak = list("HUMANS ARE IMPERFECT!", "YOU SHALL BE ASSIMILATED!", "YOU ARE HARMING YOURSELF", "You have been deemed hazardous. Will you comply?", \
@@ -242,4 +223,77 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca
var/mob/living/silicon/robot/R = the_target
if(R.connected_ai == creator) // Only attack robots that aren't synced to our creator AI.
return 0
return ..()
return ..()
/mob/living/simple_animal/hostile/mimic/copy/ranged
var/obj/item/weapon/gun/TrueGun = null
var/obj/item/weapon/gun/magic/Zapstick
var/obj/item/weapon/gun/projectile/Pewgun
var/obj/item/weapon/gun/energy/Zapgun
/mob/living/simple_animal/hostile/mimic/copy/ranged/CopyObject(obj/O, mob/living/creator, destroy_original = 0)
if(..())
emote_see = list("aims menacingly")
environment_smash = 0 //needed? seems weird for them to do so
ranged = 1
retreat_distance = 1 //just enough to shoot
minimum_distance = 6
var/obj/item/weapon/gun/G = O
melee_damage_upper = G.force
melee_damage_lower = G.force - max(0, (G.force / 2))
move_to_delay = 2 * G.w_class + 1
projectilesound = G.fire_sound
TrueGun = G
if(istype(G, /obj/item/weapon/gun/magic))
Zapstick = G
var/obj/item/ammo_casing/magic/M = Zapstick.ammo_type
projectiletype = initial(M.projectile_type)
if(istype(G, /obj/item/weapon/gun/projectile))
Pewgun = G
var/obj/item/ammo_box/magazine/M = Pewgun.mag_type
casingtype = initial(M.ammo_type)
if(istype(G, /obj/item/weapon/gun/energy))
Zapgun = G
var/selectfiresetting = Zapgun.select
var/obj/item/ammo_casing/energy/E = Zapgun.ammo_type[selectfiresetting]
projectiletype = initial(E.projectile_type)
/mob/living/simple_animal/hostile/mimic/copy/ranged/OpenFire(the_target)
if(Zapgun)
if(Zapgun.power_supply)
var/obj/item/ammo_casing/energy/shot = Zapgun.ammo_type[Zapgun.select]
if(Zapgun.power_supply.charge >= shot.e_cost)
Zapgun.power_supply.use(shot.e_cost)
Zapgun.update_icon()
..()
else if(Zapstick)
if(Zapstick.charges)
Zapstick.charges--
Zapstick.update_icon()
..()
else if(Pewgun)
if(Pewgun.chambered)
if(Pewgun.chambered.BB)
qdel(Pewgun.chambered.BB)
Pewgun.chambered.BB = null //because qdel takes too long, ensures icon update
Pewgun.chambered.update_icon()
..()
else
visible_message("<span class='danger'>The <b>[src]</b> clears a jam!</span>")
Pewgun.chambered.loc = loc //rip revolver immersions, blame shotgun snowflake procs
Pewgun.chambered = null
if(Pewgun.magazine && Pewgun.magazine.stored_ammo.len)
Pewgun.chambered = Pewgun.magazine.get_round(0)
Pewgun.chambered.loc = Pewgun
Pewgun.update_icon()
else if(Pewgun.magazine && Pewgun.magazine.stored_ammo.len) //only true for pumpguns i think
Pewgun.chambered = Pewgun.magazine.get_round(0)
Pewgun.chambered.loc = Pewgun
visible_message("<span class='danger'>The <b>[src]</b> cocks itself!</span>")
else
ranged = 0 //BANZAIIII
retreat_distance = 0
minimum_distance = 1
return
icon_state = TrueGun.icon_state
icon_living = TrueGun.icon_state
@@ -32,8 +32,6 @@
ranged = 1
retreat_distance = 5
minimum_distance = 5
projectiletype = /obj/item/projectile/bullet
projectilesound = 'sound/weapons/Gunshot.ogg'
casingtype = /obj/item/ammo_casing/a357
loot = list(/obj/effect/landmark/mobcorpse/russian/ranged, /obj/item/weapon/gun/projectile/revolver/mateba)
@@ -45,4 +43,4 @@
/mob/living/simple_animal/hostile/russian/death()
..()
qdel(src)
return
return
@@ -88,8 +88,6 @@
icon_state = "syndicateranged"
icon_living = "syndicateranged"
casingtype = /obj/item/ammo_casing/c45
projectilesound = 'sound/weapons/Gunshot_smg.ogg'
projectiletype = /obj/item/projectile/bullet/midbullet2
loot = list(/obj/effect/landmark/mobcorpse/syndicatesoldier, /obj/item/weapon/gun/projectile/automatic/c20r)
/mob/living/simple_animal/hostile/syndicate/ranged/space
@@ -130,4 +128,4 @@
..()
visible_message("\red <b>[src]</b> is smashed into pieces!")
qdel(src)
return
return
+5 -1
View File
@@ -12,6 +12,7 @@
icon_state = "pulse1_bl"
damage_type = BURN //OXY does not kill IPCs
damage = 50000
nodamage = 0
/obj/item/projectile/magic/fireball
name = "bolt of fireball"
@@ -254,7 +255,10 @@ proc/wabbajack(mob/living/M)
qdel(src)
else
var/obj/O = change
new /mob/living/simple_animal/hostile/mimic/copy(O.loc, O, firer)
if(istype(O, /obj/item/weapon/gun))
new /mob/living/simple_animal/hostile/mimic/copy/ranged(O.loc, O, firer)
else
new /mob/living/simple_animal/hostile/mimic/copy(O.loc, O, firer)
else if(istype(change, /mob/living/simple_animal/hostile/mimic/copy))
// Change our allegiance!
var/mob/living/simple_animal/hostile/mimic/copy/C = change