Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

[CLOSED] Everyone dies in safety blanket (Bugs)

Hey guys im just gonna post my code here cause I have alot of homeworks. I killed the peasants and it still works. The hero attacks peasants and I win. heres my code.

// This is an array of nearby names!
// Enemies are at the 0, 2, 4, and 6 indexes of the array.
var names = [
    "Thabt", "Victor", // 0, 1
    "Leerer", "Alianor", // 2, 3
    "Gorylo", "Millicent", // 4, 5
    "Weeb", "Brom" // 6, 7
];

// Attack the first two ogres at indexes 0 and 4.
hero.attack(names[1]);
hero.attack(names[0]);
hero.attack(names[5]);
hero.attack(names[4]);
// Attack the ogre at index 2:
hero.attack(names[2]);
hero.attack(names[3]);
// Attack the ogre at index 6:
hero.attack(names[7]);
hero.attack(names[6]);

It still works

2 Likes

Delete all the names[ x ] where x%2=1 (x is a placeholder)

I meant you still win doing this. I just randomly decided to attack everyone and it worked. They should put All humans must survive or something.

2 Likes

So did you manage to have all peasants alive with the help I offered to you?

Yea I did I changed it about 2 hours ago

2 Likes

Ok, then congratulations!

Calling someone to read it and do something about this @stephanie

2 Likes

@Monsty – Sure, I can take a look. Can you remind me what world this is in?

1 Like

It’s in Sarven Desert: https://codecombat.com/play/level/safety-blanket

1 Like

@Monsty – I ran your code listed above several times, but it did not work for me. Maybe someone else can help confirm that this is or isn’t happening for them too?

1 Like

Okay @stephanie! I hope someone fixes it.

1 Like

Errr, yes. I tried athian’s code, and I can confirm that all the peasants are dead at the end, and it still says I’ve succeeded…

1 Like

Yikes that’s a little strange. @stephanie I’ll take a look at the level.

1 Like

This is intentional, as the goal is to kill the ogres, but the goals never mentioned that pheasants must survive, therefore it does not affect the level results even if you kill the pheasants. Confirmed not a bug.

1 Like

Thank you for checking on this @jka2706 @Chaboi_3000 :slightly_smiling_face:

1 Like

This topic was automatically closed after 6 days. New replies are no longer allowed.