Improved creature AI and random mob spawning in caves.

Also equipment lockers.

Conflicts:
	code/game/objects/items/weapons/cards_ids.dm
	code/modules/mining/materials.dm
	code/modules/mining/mine_turfs.dm
	code/modules/mining/ores_coins.dm
	code/modules/mob/living/simple_animal/hostile/mining_mobs.dm
	code/modules/projectiles/ammunition/bullets.dm
	code/modules/projectiles/guns/energy/special.dm
	compare_report_tg.txt
	icons/obj/device.dmi
	icons/obj/mining.dmi
	icons/obj/vehicles.dmi
	maps/tgstation.2.1.0.0.1.dmm
	maps/vgstation1.0.0.dmm
This commit is contained in:
Rob Nelson
2014-02-15 00:22:24 -08:00
committed by ZomgPonies
parent 6ad3ca77f1
commit 71c07e208a
15 changed files with 1043 additions and 68 deletions
@@ -266,9 +266,11 @@
var/list/directions = cardinal.Copy()
for(var/dir in directions)
var/turf/T = get_step(src, dir)
if(istype(T, /turf/simulated/wall))
if(istype(T, /turf/simulated/wall) && T.Adjacent(src))
T.attack_animal(src)
for(var/atom/A in T)
if(!A.Adjacent(src))
continue
if(istype(A, /obj/structure/window) || istype(A, /obj/structure/closet) || istype(A, /obj/structure/table) || istype(A, /obj/structure/grille) || istype(A, /obj/structure/rack))
A.attack_animal(src)
return
@@ -29,19 +29,21 @@
..()
icon_state = icon_living
/mob/living/simple_animal/hostile/asteroid/bullet_act(var/obj/item/projectile/P)//Limits the weapons available to kill them at range
if(P.damage < 30)
visible_message("<span class='danger'>The [P.name] had no effect on [src.name]!</span>")
/mob/living/simple_animal/hostile/asteroid/bullet_act(var/obj/item/projectile/P)//Reduces damage from most projectiles to curb off-screen kills
if(!stat)
Aggro()
return
if(P.damage < 30)
P.damage = (P.damage / 2)
visible_message("<span class='danger'>The [P] has a reduced effect on [src]!</span>")
..()
/mob/living/simple_animal/hostile/asteroid/hitby(atom/movable/AM)//No floor tiling them to death, wiseguy
if(istype(AM, /obj/item))
var/obj/item/T = AM
if(!stat)
Aggro()
if(T.throwforce <= 15)
visible_message("<span class='notice'>The [T.name] [src.throw_message] [src.name]!</span>")
Aggro()
return
..()
@@ -59,19 +61,21 @@
projectilesound = 'sound/weapons/pierce.ogg'
ranged = 1
ranged_message = "stares"
ranged_cooldown_cap = 8
ranged_cooldown_cap = 20
throw_message = "does nothing against the hard shell of"
vision_range = 2
speed = 3
maxHealth = 200
health = 200
harm_intent_damage = 5
melee_damage_lower = 15
melee_damage_upper = 15
melee_damage_lower = 12
melee_damage_upper = 12
attacktext = "bites into"
a_intent = "harm"
attack_sound = 'sound/weapons/bladeslice.ogg'
ranged_cooldown_cap = 4
aggro_vision_range = 9
idle_vision_range = 2
/obj/item/projectile/temp/basilisk
name = "freezing blast"
@@ -94,7 +98,23 @@
visible_message("<span class='danger'>The [src.name]'s stare chills [L.name] to the bone!</span>")
return
/mob/living/simple_animal/hostile/asteroid/Goldgrub
/mob/living/simple_animal/hostile/asteroid/basilisk/ex_act(severity)
switch(severity)
if(1.0)
gib()
if(2.0)
adjustBruteLoss(140)
if(3.0)
adjustBruteLoss(110)
/mob/living/simple_animal/hostile/asteroid/basilisk/Die()
var/counter
for(counter=0, counter<2, counter++)
var/obj/item/weapon/ore/diamond/D = new /obj/item/weapon/ore/diamond(src.loc)
D.layer = 4.1
..()
/mob/living/simple_animal/hostile/asteroid/goldgrub
name = "goldgrub"
desc = "A worm that grows fat from eating everything in its sight. Seems to enjoy precious metals and other shiny things, hence the name."
icon = 'icons/mob/animal.dmi'
@@ -103,11 +123,13 @@
icon_aggro = "Goldgrub_alert"
icon_dead = "Goldgrub_dead"
icon_gib = "syndicate_gib"
vision_range = 6
vision_range = 3
aggro_vision_range = 9
idle_vision_range = 3
move_to_delay = 3
friendly = "harmlessly rolls into"
maxHealth = 45
health = 45
maxHealth = 60
health = 60
harm_intent_damage = 5
melee_damage_lower = 0
melee_damage_upper = 0
@@ -115,48 +137,78 @@
a_intent = "help"
throw_message = "sinks in slowly, before being pushed out of "
status_flags = CANPUSH
search_objects = 2
wanted_objects = list(/obj/item/weapon/ore/diamond, /obj/item/weapon/ore/gold, /obj/item/weapon/ore/silver, /obj/item/weapon/ore/plasma,
/obj/item/weapon/ore/uranium, /obj/item/weapon/ore/iron, /obj/item/weapon/ore/clown)
var/alerted = 0
search_objects = 1
wanted_objects = list(/obj/item/weapon/ore/diamond, /obj/item/weapon/ore/gold, /obj/item/weapon/ore/silver,
/obj/item/weapon/ore/uranium)
/mob/living/simple_animal/hostile/asteroid/Goldgrub/GiveTarget(var/new_target)
var/list/ore_types_eaten = list()
var/alerted = 0
var/ore_eaten = 1
var/chase_time = 100
/mob/living/simple_animal/hostile/asteroid/goldgrub/GiveTarget(var/new_target)
target = new_target
if(target != null)
if(istype(target, /obj/item/weapon/ore))
visible_message("<span class='notice'>The [src.name] looks at [target.name] with hungry eyes.</span>")
stance = HOSTILE_STANCE_ATTACK
if(isliving(target) && !search_objects)
return
if(isliving(target))
Aggro()
stance = HOSTILE_STANCE_ATTACK
visible_message("<span class='danger'>The [src.name] tries to flee from [target.name]!</span>")
retreat_distance = 10
minimum_distance = 10
Burrow()
return
return
/obj/item/weapon/ore/attack_animal(var/mob/living/L)
if(istype(L, /mob/living/simple_animal/hostile/asteroid/Goldgrub))
L.visible_message("<span class='notice'>The [src.name] was swallowed whole!</span>")
del(src)
/mob/living/simple_animal/hostile/asteroid/goldgrub/AttackingTarget()
if(istype(target, /obj/item/weapon/ore))
EatOre(target)
return
..()
/mob/living/simple_animal/hostile/asteroid/Goldgrub/proc/Burrow()//Begin the chase to kill the goldgrub in time
/mob/living/simple_animal/hostile/asteroid/goldgrub/proc/EatOre(var/atom/targeted_ore)
for(var/obj/item/weapon/ore/O in targeted_ore.loc)
ore_eaten++
if(!(O.type in ore_types_eaten))
ore_types_eaten += O.type
del(O)
if(ore_eaten > 5)//Limit the scope of the reward you can get, or else things might get silly
ore_eaten = 5
visible_message("<span class='notice'>The ore was swallowed whole!</span>")
/mob/living/simple_animal/hostile/asteroid/goldgrub/proc/Burrow()//Begin the chase to kill the goldgrub in time
if(!alerted)
alerted = 1
spawn(100)
if(alerted)
visible_message("<span class='danger'>The [src.name] buries into the ground, vanishing from sight!</span>")
del(src)
spawn(chase_time)
if(alerted)
visible_message("<span class='danger'>The [src.name] buries into the ground, vanishing from sight!</span>")
del(src)
/mob/living/simple_animal/hostile/asteroid/Goldgrub/bullet_act(var/obj/item/projectile/P)
/mob/living/simple_animal/hostile/asteroid/goldgrub/proc/Reward()
if(!ore_eaten || ore_types_eaten.len == 0)
return
visible_message("<span class='danger'>[src] spits up the contents of its stomach before dying!</span>")
var/counter
for(var/R in ore_types_eaten)
for(counter=0, counter < ore_eaten, counter++)
new R(src.loc)
ore_types_eaten.Cut()
ore_eaten = 0
/mob/living/simple_animal/hostile/asteroid/goldgrub/bullet_act(var/obj/item/projectile/P)
visible_message("<span class='danger'>The [P.name] was repelled by [src.name]'s girth!</span>")
return
/mob/living/simple_animal/hostile/asteroid/Goldgrub/Die()
/mob/living/simple_animal/hostile/asteroid/goldgrub/Die()
alerted = 0
Reward()
..()
/mob/living/simple_animal/hostile/asteroid/Hivelord
/mob/living/simple_animal/hostile/asteroid/hivelord
name = "hivelord"
desc = "A truly alien creature, it is a mass of unknown organic material, constantly fluctuating. When attacking, pieces of it split off and attack in tandem with the original."
icon = 'icons/mob/animal.dmi'
@@ -166,34 +218,72 @@
icon_dead = "Hivelord_dead"
icon_gib = "syndicate_gib"
mouse_opacity = 2
move_to_delay = 12
move_to_delay = 14
ranged = 1
vision_range = 4
vision_range = 5
aggro_vision_range = 9
idle_vision_range = 5
speed = 3
maxHealth = 75
health = 75
harm_intent_damage = 5
melee_damage_lower = 2
melee_damage_upper = 2
melee_damage_lower = 0
melee_damage_upper = 0
attacktext = "lashes out at"
throw_message = "falls right through the strange body of the"
ranged_cooldown = 0
ranged_cooldown_cap = 0
environment_smash = 0
retreat_distance = 5
minimum_distance = 5
retreat_distance = 3
minimum_distance = 3
pass_flags = PASSTABLE
/mob/living/simple_animal/hostile/asteroid/Hivelord/OpenFire(var/the_target)
var/mob/living/simple_animal/hostile/asteroid/Hivelordbrood/A = new /mob/living/simple_animal/hostile/asteroid/Hivelordbrood(src.loc)
/mob/living/simple_animal/hostile/asteroid/hivelord/OpenFire(var/the_target)
var/mob/living/simple_animal/hostile/asteroid/hivelordbrood/A = new /mob/living/simple_animal/hostile/asteroid/hivelordbrood(src.loc)
A.GiveTarget(target)
A.friends = friends
A.faction = faction
return
/mob/living/simple_animal/hostile/asteroid/Hivelord/AttackingTarget()
/mob/living/simple_animal/hostile/asteroid/hivelord/AttackingTarget()
OpenFire()
/mob/living/simple_animal/hostile/asteroid/hivelord/Die()
new /obj/item/asteroid/hivelord_core(src.loc)
..()
/mob/living/simple_animal/hostile/asteroid/Hivelordbrood
/obj/item/asteroid/hivelord_core
name = "hivelord remains"
desc = "All that remains of a hivelord, it seems to be what allows it to break pieces of itself off without being hurt... its healing properties will soon become inert if not used quickly. Try not to think about what you're eating."
icon = 'icons/obj/food.dmi'
icon_state = "boiledrorocore"
var/inert = 0
/obj/item/asteroid/hivelord_core/New()
spawn(1200)
inert = 1
desc = "The remains of a hivelord that have become useless, having been left alone too long after being harvested."
/obj/item/asteroid/hivelord_core/attack(mob/living/M as mob, mob/living/user as mob)
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(inert)
user << "<span class='notice'>[src] have become inert, its healing properties are no more.</span>"
return
else
if(H.stat == DEAD)
user << "<span class='notice'>[src] are useless on the dead.</span>"
return
if(H != user)
H.visible_message("<span class='notice'>[user] forces [H] to eat [src]... they quickly regenerate all injuries!</span>")
else
user << "<span class='notice'>You chomp into [src], barely managing to hold it down, but feel amazingly refreshed in mere moments.</span>"
playsound(src.loc,'sound/items/eatfood.ogg', rand(10,50), 1)
H.revive()
del(src)
..()
/mob/living/simple_animal/hostile/asteroid/hivelordbrood
name = "hivelord brood"
desc = "A fragment of the original Hivelord, rallying behind its original. One isn't much of a threat, but..."
icon = 'icons/mob/animal.dmi'
@@ -217,15 +307,15 @@
environment_smash = 0
pass_flags = PASSTABLE
/mob/living/simple_animal/hostile/asteroid/Hivelordbrood/New()
/mob/living/simple_animal/hostile/asteroid/hivelordbrood/New()
..()
spawn(100)
del(src)
/mob/living/simple_animal/hostile/asteroid/Hivelordbrood/Die()
/mob/living/simple_animal/hostile/asteroid/hivelordbrood/Die()
del(src)
/mob/living/simple_animal/hostile/asteroid/Goliath
/mob/living/simple_animal/hostile/asteroid/goliath
name = "goliath"
desc = "A massive beast that uses long tentacles to ensare its prey, threatening them is not advised under any conditions."
icon = 'icons/mob/animal.dmi'
@@ -234,6 +324,7 @@
icon_aggro = "Goliath_alert"
icon_dead = "Goliath_dead"
icon_gib = "syndicate_gib"
attack_sound = 'sound/weapons/punch4.ogg'
mouse_opacity = 2
move_to_delay = 40
ranged = 1
@@ -248,15 +339,17 @@
melee_damage_upper = 25
attacktext = "pulverizes"
throw_message = "does nothing to the rocky hide of the"
aggro_vision_range = 9
idle_vision_range = 5
/mob/living/simple_animal/hostile/asteroid/Goliath/OpenFire()
/mob/living/simple_animal/hostile/asteroid/goliath/OpenFire()
visible_message("<span class='warning'>The [src.name] digs its tentacles under [target.name]!</span>")
var/tturf = get_turf(target)
new /obj/effect/goliath_tentacle/original(tturf)
ranged_cooldown = ranged_cooldown_cap
return
/mob/living/simple_animal/hostile/asteroid/Goliath/adjustBruteLoss(var/damage)
/mob/living/simple_animal/hostile/asteroid/goliath/adjustBruteLoss(var/damage)
ranged_cooldown--
..()
@@ -297,3 +390,28 @@
return
..()
/mob/living/simple_animal/hostile/asteroid/goliath/Die()
var/obj/item/asteroid/goliath_hide/G = new /obj/item/asteroid/goliath_hide(src.loc)
G.layer = 4.1
..()
/obj/item/asteroid/goliath_hide
name = "goliath hide plates"
desc = "Pieces of a goliath's rocky hide, these might be able to make your suit a bit more durable to attack from the local fauna."
icon = 'icons/obj/items.dmi'
icon_state = "goliath_hide"
w_class = 3
layer = 4
/obj/item/asteroid/goliath_hide/afterattack(atom/target, mob/user, proximity_flag)
if(proximity_flag)
if(istype(target, /obj/item/clothing/suit/space/rig/mining) || istype(target, /obj/item/clothing/head/helmet/space/rig/mining))
var/obj/item/clothing/C = target
var/current_armor = C.armor
if(current_armor.["melee"] < 90)
current_armor.["melee"] = min(current_armor.["melee"] + 10, 90)
user << "<span class='info'>You strengthen [target], improving its resistance against melee attacks.</span>"
del(src)
else
user << "<span class='info'>You can't improve [C] any further.</span>"
return