Added a "faction" var to mobs. This var gets checked when hostile simple animals attack something. Default is "neutral."

Changed the hostile code to allow for ranged mobs. Will port syndies over to hostile at some point (I don't want to go and replace the syndies on all the away maps right now).

Added pirate simple animals for Inti (icons are from him). Icons for russians and an on mob bear belt are in as well. There is a ranged version and a melee version.

Set factions for constructs, shades, carp, bears, faithless.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5176 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
Kortgstation@gmail.com
2012-11-24 13:19:08 +00:00
parent 7926b373af
commit 338b934160
12 changed files with 160 additions and 13 deletions

View File

@@ -23,6 +23,7 @@
min_n2 = 0
max_n2 = 0
minbodytemp = 0
faction = "cult"
/mob/living/simple_animal/construct/Life()
@@ -204,7 +205,7 @@
icon_living = "artificer"
maxHealth = 50
health = 50
response_harm = "viciously beats"
response_harm = "viciously beats"
harm_intent_damage = 5
melee_damage_lower = 5
melee_damage_upper = 5

View File

@@ -119,3 +119,17 @@
corpseid = 1
corpseidjob = "Clown"
corpseidaccess = "Clown"
/obj/effect/landmark/mobcorpse/pirate
name = "Pirate"
corpseuniform = /obj/item/clothing/under/pirate
corpseshoes = /obj/item/clothing/shoes/jackboots
corpseglasses = /obj/item/clothing/glasses/eyepatch
corpsehelmet = /obj/item/clothing/head/bandana
/obj/effect/landmark/mobcorpse/pirateranged
name = "Pirate"
corpseuniform = /obj/item/clothing/under/pirate
corpseshoes = /obj/item/clothing/shoes/jackboots
corpsesuit = /obj/item/clothing/suit/pirate
corpsehelmet = /obj/item/clothing/head/pirate

View File

@@ -34,6 +34,9 @@
max_n2 = 0
minbodytemp = 0
var/stance_step = 0
faction = "russian"
//SPACE BEARS! SQUEEEEEEEE~ OW! FUCK! IT BIT MY HAND OFF!!
/mob/living/simple_animal/hostile/bear/Hudson
name = "Hudson"

View File

@@ -35,6 +35,8 @@
max_n2 = 0
minbodytemp = 0
faction = "carp"
/mob/living/simple_animal/hostile/carp/Process_Spacemove(var/check_drift = 0)
return 1 //No drifting in space for space carp! //original comments do not steal

View File

@@ -30,6 +30,8 @@
max_n2 = 0
minbodytemp = 0
faction = "faithless"
/mob/living/simple_animal/hostile/faithless/Process_Spacemove(var/check_drift = 0)
return 1

View File

@@ -1,8 +1,14 @@
/mob/living/simple_animal/hostile
faction = "hostile"
var/stance = HOSTILE_STANCE_IDLE //Used to determine behavior
var/mob/living/target_mob //Once the bear enters attack stance, it will try to chase this mob. This it to prevent it changing it's mind between multiple mobs.
var/mob/living/target_mob
var/attack_same = 0
var/ranged = 0
var/rapid = 0
var/projectiletype
var/projectilesound
var/casingtype
var/target //used for shooting
/mob/living/simple_animal/hostile/proc/FindTarget()
@@ -10,15 +16,15 @@
stop_automated_movement = 0
for(var/atom/A in ListTargets())
if(!attack_same && istype(A, src.type))
continue
if(isliving(A))
var/mob/living/L = A
if(!L.stat)
stance = HOSTILE_STANCE_ATTACK
T = L
break
if(L.faction == src.faction)
continue
else
if(!L.stat)
stance = HOSTILE_STANCE_ATTACK
T = L
break
if(istype(A, /obj/mecha))
var/obj/mecha/M = A
if (M.occupant)
@@ -32,8 +38,14 @@
if(!target_mob || SA_attackable(target_mob))
stance = HOSTILE_STANCE_IDLE
if(target_mob in ListTargets())
walk_to(src, target_mob, 1, 2)
stance = HOSTILE_STANCE_ATTACKING
if(ranged)
if(get_dist(src, target_mob) <= 6)
OpenFire(target_mob)
else
walk_to(src, target_mob, 1, 2)
else
walk_to(src, target_mob, 1, 2)
stance = HOSTILE_STANCE_ATTACKING
/mob/living/simple_animal/hostile/proc/AttackTarget()
@@ -87,8 +99,56 @@
if(HOSTILE_STANCE_IDLE)
target_mob = FindTarget()
if(HOSTILE_STANCE_ATTACK) //This one should only be active for one tick
if(HOSTILE_STANCE_ATTACK)
MoveToTarget()
if(HOSTILE_STANCE_ATTACKING)
AttackTarget()
/mob/living/simple_animal/hostile/proc/OpenFire(target_mob)
src.target = target_mob
visible_message("\red <b>[src]</b> fires at [src.target]!", 1)
var/tturf = get_turf(target)
if(rapid)
spawn(1)
Shoot(tturf, src.loc, src)
if(casingtype)
new casingtype
spawn(4)
Shoot(tturf, src.loc, src)
if(casingtype)
new casingtype
spawn(6)
Shoot(tturf, src.loc, src)
if(casingtype)
new casingtype
else
Shoot(tturf, src.loc, src)
if(casingtype)
new casingtype
stance = HOSTILE_STANCE_IDLE
target_mob = null
return
/mob/living/simple_animal/hostile/proc/Shoot(var/target, var/start, var/user, var/bullet = 0)
if(target == start)
return
var/obj/item/projectile/A = new projectiletype(user:loc)
playsound(user, projectilesound, 100, 1)
if(!A) return
if (!istype(target, /turf))
del(A)
return
A.current = target
A.yo = target:y - start:y
A.xo = target:x - start:x
spawn( 0 )
A.process()
return

View File

@@ -0,0 +1,57 @@
/mob/living/simple_animal/hostile/pirate
name = "Pirate"
desc = "Does what he wants cause a pirate is free."
icon_state = "piratemelee"
icon_living = "piratemelee"
icon_dead = "piratemelee_dead"
speak_chance = 0
turns_per_move = 5
response_help = "pushes the"
response_disarm = "shoves"
response_harm = "hits the"
speed = -1
stop_automated_movement_when_pulled = 0
maxHealth = 100
health = 100
harm_intent_damage = 5
melee_damage_lower = 30
melee_damage_upper = 30
attacktext = "slashes"
attack_sound = 'sound/weapons/bladeslice.ogg'
min_oxy = 5
max_oxy = 0
min_tox = 0
max_tox = 1
min_co2 = 0
max_co2 = 5
min_n2 = 0
max_n2 = 0
unsuitable_atoms_damage = 15
var/corpse = /obj/effect/landmark/mobcorpse/pirate
var/weapon1 = /obj/item/weapon/melee/energy/sword/pirate
faction = "pirate"
/mob/living/simple_animal/hostile/pirate/ranged
name = "Pirate Gunner"
icon_state = "pirateranged"
icon_living = "pirateranged"
icon_dead = "piratemelee_dead"
projectilesound = 'sound/weapons/laser.ogg'
ranged = 1
rapid = 1
projectiletype = /obj/item/projectile/beam
corpse = /obj/effect/landmark/mobcorpse/pirateranged
weapon1 = /obj/item/weapon/gun/energy/laser
/mob/living/simple_animal/hostile/pirate/Life()
..()
if(stat == 2)
new corpse (src.loc)
if(weapon1)
new weapon1 (src.loc)
del src
return

View File

@@ -24,6 +24,7 @@
speed = -1
stop_automated_movement = 1
status_flags = 0
faction = "cult"
Life()

View File

@@ -149,6 +149,9 @@
var/voice_message = null // When you are not understood by others (replaced with just screeches, hisses, chimpers etc.)
var/say_message = null // When you are understood by others. Currently only used by aliens and monkeys in their say_quote procs
var/faction = "neutral" //Used for checking whether hostile simple animals will attack you, possibly more stuff later
//Generic list for proc holders. Only way I can see to enable certain verbs/procs. Should be modified if needed.
var/proc_holder_list[] = list()//Right now unused.
//Also unlike the spell list, this would only store the object in contents, not an object in itself.