scrom / Experiments

a NodeJS text adventure - deliberately coded badly to re-experience the pain of legacy code
http://mvta.herokuapp.com/
2 stars 0 forks source link

introduce escort/defend/block/heal creature related missions #179

Open scrom opened 10 years ago

scrom commented 10 years ago

e.g.

scrom commented 10 years ago

see issue #192 for a challenge with the "heal" missions

scrom commented 10 years ago

Now that creature paths are implemented, and we're looking at "fail" attributes, this is coming closer to reality.

For escort missions, it may be that you meet a creature in a particular location and their path is set to the destination when you arrive. This would need the similar "initial" attributes idea as issue #192 although with the added need to trigger those attributes when encountering a creature, not just when triggering the mission. (although this could be achieved with a parent/child mission setup with just initial destination attributes on the child.

scrom commented 10 years ago

the zombie mission includes preventing all friendly NPCs from dying. a fail check can now also be implemented to fail a mission if a creature is dead or an object is destroyed. It might be possible to fail a mission if a creature reaches a given location using a "currentLocationName" attribute. Would probably need to pass the mission with a timeout. E.g. keep x away from location y until z.

The code for the currentLoction Name would be:

        if (_currentLocation) {
            currentAttributes.currentLocationName = _currentLocation.getName();
        } else {
            currentAttributes.currentLocationName = null;
        };

In creature.getCurrentAttributes