/* Change healing behaviour: Logic/Pseudocode */ /* Comment: From what I see so far the 'big' change to current code will be what units look for a healer. Bear in mind this is pretty simple and rushed pseudocode ;) */ /** @todo MORE DETAIL */ // in marked parts /** @todo FUNCTIONS */ // find existing / make new ones // Turn starts of side 'X': /** @todo MORE DETAIL */ // Cycle through all units on the map and // find all wounded/poisoned units of X and X's allies -> wounded_units for each wounded_unit of wounded_units do { // Check status of wounded_unit -> bIsWounded -> bIsPoisoned /** @todo MORE DETAIL */ //Check if a healer and/or curer is nearby (including villages!) -> can_be_healed(max_amount, healing_unit) -> can_be_cured(curing_unit) // healing_unit or curing_unit = null --> village // poison if (bIsPoisoned) { // can be cured if (can_be_cured()) { cure_unit(unit,curing_unit) // check next wounded_unit continue; } // poison can be slowed (no damage, no change) else if ( can_be_healed.max_amount > 0) { // check next wounded_unit continue; } // noone here to help else { do_poison_damage(wounded_unit) // check next wounded_unit continue; } } // healing if (bIsWounded && can_be_healed()) { heal_unit(unit,healing_unit,max_amount) } // check next wounded_unit }