Cleaned up environment_smash vars with bitflag defines (#2515)

This commit is contained in:
CitadelStationBot
2017-08-27 07:55:07 -05:00
committed by kevinz000
parent 718940042a
commit 94429bdccc
7 changed files with 11 additions and 13 deletions
@@ -2,7 +2,7 @@
faction = list("hostile")
stop_automated_movement_when_pulled = 0
obj_damage = 40
environment_smash = ENVIRONMENT_SMASH_STRUCTURES //Set to 1 to break closets,tables,racks, etc; 2 for walls; 3 for rwalls
environment_smash = ENVIRONMENT_SMASH_STRUCTURES //Bitflags. Set to ENVIRONMENT_SMASH_STRUCTURES to break closets,tables,racks, etc; ENVIRONMENT_SMASH_WALLS for walls; ENVIRONMENT_SMASH_RWALLS for rwalls
var/atom/target
var/ranged = 0
var/rapid = 0
@@ -253,7 +253,7 @@
if(target.loc != null && get_dist(targets_from, target.loc) <= vision_range) //We can't see our target, but he's in our vision range still
if(ranged_ignores_vision && ranged_cooldown <= world.time) //we can't see our target... but we can fire at them!
OpenFire(target)
if(environment_smash >= 2) //If we're capable of smashing through walls, forget about vision completely after finding our target
if((environment_smash & ENVIRONMENT_SMASH_WALLS) || (environment_smash & ENVIRONMENT_SMASH_RWALLS)) //If we're capable of smashing through walls, forget about vision completely after finding our target
Goto(target,move_to_delay,minimum_distance)
FindHidden()
return 1
@@ -122,6 +122,6 @@
A.melee_damage_lower = max((A.melee_damage_lower * 2), 10)
A.melee_damage_upper = max((A.melee_damage_upper * 2), 10)
A.transform *= 2
A.environment_smash += 2
A.environment_smash |= ENVIRONMENT_SMASH_STRUCTURES | ENVIRONMENT_SMASH_RWALLS
to_chat(user, "<span class='info'>You increase the size of [A], giving it a surge of strength!</span>")
qdel(src)
@@ -128,7 +128,7 @@ field_generator power level display
return ..()
/obj/machinery/field/generator/attack_animal(mob/living/simple_animal/M)
if(M.environment_smash >= 3 && active == FG_OFFLINE && state != FG_UNSECURED)
if(M.environment_smash & ENVIRONMENT_SMASH_RWALLS && active == FG_OFFLINE && state != FG_UNSECURED)
state = FG_UNSECURED
anchored = FALSE
M.visible_message("<span class='warning'>[M] rips [src] free from its moorings!</span>")