Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // First manage damaged state, this is independant of room
- if (creep.hits < creep.hitsMax) creep.memory.damaged = true;
- else if (creep.hits == creep.hitsMax) creep.memory.damaged = false;
- // Then room logic, and priority to healing right?
- if (creep.memory.damaged) {
- creep.moveTo(Game.flags.Flag1); // Flee
- creep.heal(creep); // Heal
- } else if (currentRoom === myRoom) {
- creep.moveTo(Game.flags.Flag2); // Assuming the flag is in room 2
- } else {
- // if you go in here, that means you are in the right room, AND you are not damaged
- attack_room_with(creep); // This is a function you need to write
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement