Author: sapient
Date: Fri Jul 4 20:57:31 2008
New Revision: 27721
URL: http://svn.gna.org/viewcvs/wesnoth?rev=27721&view=rev
Log: (empty)
Modified:
trunk/changelog
trunk/src/unit.cpp
Modified: trunk/changelog
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=27721&r1=27720&r2=27721&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Fri Jul 4 20:57:31 2008
@@ -16,6 +16,7 @@
* max_attacks in [unit] now also works for values bigger than 1
* the "zoc" key works for [unit_type] too, and for [unit] accepts other
boolean values than 1 and 0 (bug #11889).
+ * new effect apply_to=type to transform the unit to a different type
* GUI improvements:
* Rewrote the textbox history saving of the new widget library. This rewrite
is incompatible with the old version, but since the library is still in
Modified: trunk/src/unit.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.cpp?rev=27721&r1=27720&r2=27721&view=diff
==============================================================================
--- trunk/src/unit.cpp (original)
+++ trunk/src/unit.cpp Fri Jul 4 20:57:31 2008
@@ -2365,6 +2365,15 @@
if(apply_to == "variation" && no_add == false) {
variation_ = (**i.first)["name"];
advance_to(this->type());
+ } else if(apply_to == "type" && no_add ==
false) {
+ type_ = (**i.first)["name"];
+ int hit_points = hit_points_;
+ int experience = experience_;
+ int movement = movement_;
+ advance_to(this->type());
+ hit_points_ = hit_points;
+ experience_ = experience;
+ movement_ = movement;
} else if(apply_to == "profile") {
const std::string& portrait =
(**i.first)["portrait"];
const std::string& description =
(**i.first)["description"];
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits