It looks good, except, why do curers/healers not remove slow? Is there a
rationale behind this? It looks to me like it would confuse new players,
and does not really serve any purpose...
If there was a rationale somewhere, I missed it.
Jérémy Rosen wrote:
> ok, after discussing it a little more with soliton and Dragonking, here
> is one more attempt at slo
>
> - slowed units see their movement halved
> actually, movement is not halved, but movement cost is double
> this effect was already here before
> - slowed units emit no ZoC
> - slowed units have one less attack
> this effect was already there
> - slow is cured when resting or being on a village
> curers/healers don't help. only resting or staying on a village
> slow does not interact with poison or healing in anyway.
>
>
> here you go
>
-------------------------
Index: reports.cpp
===================================================================
--- reports.cpp (révision 8705)
+++ reports.cpp (copie de travail)
@@ -126,7 +126,7 @@
}
if(u->second.has_flag("slowed")) {
unit_status << "misc/slowed.png";
- tooltip << _("slowed: ") << _("This unit has been slowed.
It moves at half normal speed and receives one less attack than normal
in combat.");
+ tooltip << _("slowed: ") << _("This unit has been slowed.
It moves at half normal speed , receives one less attack than normal in
combat, and does not emit a zone of control.");
res.add_image(unit_status,tooltip);
}
if(u->second.has_flag("poisoned")) {
Index: actions.cpp
===================================================================
--- actions.cpp (révision 8705)
+++ actions.cpp (copie de travail)
@@ -1219,6 +1212,7 @@
const std::vector<team>& teams)
{
std::map<gamemap::location,int> healed_units, max_healing;
+ std::map<gamemap::location,bool> unslowed_units;
//a map of healed units to their healers
std::multimap<gamemap::location,gamemap::location> healers;
@@ -1319,8 +1313,23 @@
}
}
+ // last, add units that need unslowing
for(i = units.begin(); i != units.end(); ++i) {
+ //the unit heals if it's on this side, and it's on a village or
+ //it has regeneration, and it is wounded
if(i->second.side() == side) {
+ if( i->second.has_flag("slowed") &&
+ (map.gives_healing(i->first) ||
i->second.is_resting()) ){
+ i->second.remove_flag("slowed");
+ unslowed_units.insert(std::pair<gamemap::location,int>(
i->first, true));
+ // add it to healed_units so it gets applied
+ // note that insert won't add anything if it's already
there
+ healed_units.insert(std::pair<gamemap::location,int>(
i->first, 0));
+ }
+ }
+ }
+ for(i = units.begin(); i != units.end(); ++i) {
+ if(i->second.side() == side) {
if(i->second.hitpoints() < i->second.max_hitpoints() ||
i->second.poisoned()){
if(i->second.is_resting()) {
@@ -1392,6 +1401,17 @@
const int DelayAmount = 50;
+ // take care of unslowed units
+ if(unslowed_units[h->first]) {
+ if(show_healing) {
+ events::pump();
+
+ sound::play_sound("heal.wav");
+ SDL_Delay(DelayAmount);
+ disp.invalidate_unit();
+ disp.update_display();
+ }
+ }
LOG_NG << "unit is poisoned? " << (u.has_flag("poisoned") ?
"yes" : "no") << ","
<< h->second << "," << max_healing[h->first] << "\n";
Index: unit.cpp
===================================================================
--- unit.cpp (révision 8705)
+++ unit.cpp (copie de travail)
@@ -338,7 +338,6 @@
void unit::end_turn()
{
- remove_flag("slowed");
if((moves_ != total_movement()) && (moves_ != NOT_MOVED)){
resting_ = false;
}
@@ -499,7 +498,7 @@
bool unit::emits_zoc() const
{
- return type().has_zoc() && stone() == false;
+ return type().has_zoc() && stone() == false && !has_flag("slowed");
}
bool unit::matches_filter(const config& cfg) const
-------------------------
_______________________________________________
Wesnoth-dev mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-dev
--
Joseph Simmons
Túrin Turambar, master of doom, by doom mastered
www.wesnoth.org