Merge pull request #4156 from Fox-McCloud/mining-bot-update

Mining Bot Updates
This commit is contained in:
TheDZD
2016-04-14 19:10:26 -04:00
7 changed files with 86 additions and 4 deletions
@@ -18,6 +18,7 @@
projectilesound = 'sound/weapons/Gunshot.ogg'
projectiletype = /obj/item/projectile/hivebotbullet
faction = list("hivebot")
check_friendly_fire = 1
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
minbodytemp = 0
speak_emote = list("states")
@@ -15,6 +15,7 @@
var/ranged_message = "fires" //Fluff text for ranged mobs
var/ranged_cooldown = 0 //What the starting cooldown is on ranged attacks
var/ranged_cooldown_cap = 3 //What ranged attacks, after being used are set to, to go back on cooldown, defaults to 3 life() ticks
var/check_friendly_fire = 0 // Should the ranged mob check for friendlies when shooting
var/retreat_distance = null //If our mob runs from players when they're too close, set in tile distance. By default, mobs do not retreat.
var/minimum_distance = 1 //Minimum approach distance, so ranged mobs chase targets down, but still keep their distance set in tiles to the target, set higher to make mobs keep distance
@@ -38,7 +39,7 @@
return 0
if(ranged)
ranged_cooldown--
/mob/living/simple_animal/hostile/process_ai()
..()
if(!AICanContinue())
@@ -250,8 +251,14 @@
walk(src, 0)
/mob/living/simple_animal/hostile/proc/OpenFire(var/the_target)
var/target = the_target
if(check_friendly_fire)
for(var/turf/T in getline(src, target)) // Not 100% reliable but this is faster than simulating actual trajectory
for(var/mob/living/L in T)
if(L == src || L == target)
continue
if(faction_check(L) && !attack_same)
return
visible_message("<span class='danger'><b>[src]</b> [ranged_message] at [target]!</span>")
if(rapid)
@@ -24,6 +24,7 @@
var/weapon2
unsuitable_atmos_damage = 15
faction = list("syndicate")
check_friendly_fire = 1
status_flags = CANPUSH
/mob/living/simple_animal/hostile/syndicate/death()
+6
View File
@@ -1425,3 +1425,9 @@ mob/proc/yank_out_object()
/mob/proc/get_access()
return list() //must return list or IGNORE_ACCESS
/mob/proc/faction_check(mob/target)
for(var/F in faction)
if(F in target.faction)
return 1
return 0