rename potion: p14 to healing

fix use_item message crash
This commit is contained in:
Enno Rehling 2018-02-17 20:35:00 +01:00
parent b602ac5f1a
commit 6c572c6287
18 changed files with 40 additions and 35 deletions

View File

@ -167,7 +167,7 @@
</item>
</resource>
<resource name="p14" appearance="vial">
<resource name="healing" appearance="vial">
<item weight="0" score="120" use="yes">
<potion level="4"/>
<construction skill="alchemy" minskill="8">

View File

@ -1899,7 +1899,7 @@
<string name="p13">
<text locale="de">Elixier der Macht</text>
</string>
<string name="p14">
<string name="healing">
<text locale="de">Heiltrank</text>
</string>
@ -1945,7 +1945,7 @@
<string name="p13_p">
<text locale="de">Elixiere der Macht</text>
</string>
<string name="p14_p">
<string name="healing_p">
<text locale="de">Heiltränke</text>
</string>
@ -3640,7 +3640,7 @@
<text locale="en">One of the most rare and prized of all alchemist elixers, this potion grants the user a dragon's power for a few weeks. The potion increases the life-energy of a maximum of ten people fivefold. The effect is strongest right after drinking and slowly decreases over time. To brew this potion the alchemist needs an elvendear, a windbag, a piece of waterfinder and a spider ivy. Finally he dusts it with some minced bubblemorel and stirrs the powder into some dragon's blood. </text>
<text locale="de">Eines der seltensten und wertvollsten alchemistischen Elixiere, verleiht dieser Trank dem Anwender für einige Wochen die Kraft eines Drachen. Der Trank erhöht die Lebensenergie von maximal zehn Personen auf das fünffache. Die Wirkung ist direkt nach der Einnahme am stärksten und klingt danach langsam ab. Zur Herstellung benötigt der Alchemist ein Elfenlieb, einen Windbeutel, ein Stück Wasserfinder und einen Grünen Spinnerich. Über dieses Mischung streue er schließlich einen zerriebenen Blasenmorchel und rühre dieses Pulver unter etwas Drachenblut.</text>
</string>
<string name="p14">
<string name="healing">
<text locale="en">For a healing potion one takes the peel of a windbag and some bugleweed, stirr in some chopped elvendear and sprinkle it with the blossoms of an ice begonia. This has to cook through for four days, while a gapgrowth has to be added on the second day. Then one carefully scoops off the top layer of liquid. One such potion gives four men (or one man four times) a 50% chance to survive otherwise lethal wounds. The potion is automatically used in case of injury.</text>
<text locale="de">Für einen Heiltrank nehme man die Schale eines Windbeutels und etwas Gurgelkraut, rühre eine kleingehacktes Elfenlieb dazu und bestreue alles mit den Blüten einer Eisblume. Dies muß vier Tage lang gären, wobei man am zweiten Tag einen Spaltwachs dazutun muß. Dann ziehe man vorsichtig den oben schwimmenden Saft ab. Ein solcher Trank gibt vier Männern (oder einem Mann vier mal) im Kampf eine Chance von 50%, sonst tödliche Wunden zu überleben. Der Trank wird von ihnen automatisch bei Verletzung angewandt.</text>
</string>

View File

@ -1150,10 +1150,10 @@
<string name="p13_p">
<text locale="en">elixirs of power</text>
</string>
<string name="p14">
<string name="healing">
<text locale="en">healing potion</text>
</string>
<string name="p14_p">
<string name="healing_p">
<text locale="en">healing potions</text>
</string>

View File

@ -1157,10 +1157,10 @@
<string name="p13_p">
<text locale="fr">elixir d'endurance</text>
</string>
<string name="p14">
<string name="healing">
<text locale="fr">potion de survie</text>
</string>
<string name="p14_p">
<string name="healing_p">
<text locale="fr">potions de survie</text>
</string>

View File

@ -6797,8 +6797,8 @@
<arg name="item" type="resource"/>
<arg name="amount" type="int"/>
</type>
<text locale="de">"$unit($unit) benutzt $amount $resource($item,$amount)."</text>
<text locale="en">"$unit($unit) uses $amount $resource($item,$amount)."</text>
<text locale="de">"$unit($unit) benutzt $int($amount) $resource($item,$amount)."</text>
<text locale="en">"$unit($unit) uses $int($amount) $resource($item,$amount)."</text>
</message>
<message name="no_attack_after_advance" section="errors">
<type>

View File

@ -52,7 +52,7 @@
</item>
</resource>
<resource name="p14" appearance="vial">
<resource name="healing" appearance="vial">
<!-- Heiltrank -->
<item weight="0" score="120" use="yes">
<potion level="4"/>

View File

@ -7,7 +7,7 @@
<entry spell="create_potion_peasantblood" level="5" />
<entry spell="create_potion_ointment" level="6" />
<entry spell="create_potion_p3" level="7" />
<entry spell="create_potion_p14" level="8" />
<entry spell="create_potion_healing" level="8" />
<entry spell="create_potion_p13" level="9" />
<entry spell="create_roi" level="7" />
<entry spell="create_aots" level="6" />

View File

@ -7,7 +7,7 @@
<entry spell="create_potion_peasantblood" level="5" />
<entry spell="create_potion_ointment" level="6" />
<entry spell="create_potion_p3" level="7" />
<entry spell="create_potion_p14" level="8" />
<entry spell="create_potion_healing" level="8" />
<entry spell="create_potion_p13" level="9" />
<entry spell="create_roi" level="7" />
<entry spell="create_aots" level="6" />

View File

@ -38,7 +38,7 @@
<entry spell="create_potion_ointment" level="6" />
<entry spell="create_potion_p0" level="3" />
<entry spell="create_potion_p13" level="9" />
<entry spell="create_potion_p14" level="8" />
<entry spell="create_potion_healing" level="8" />
<entry spell="create_potion_p2" level="2" />
<entry spell="create_potion_p3" level="7" />
<entry spell="create_potion_p9" level="4" />

View File

@ -7,7 +7,7 @@
<entry spell="create_potion_peasantblood" level="5" />
<entry spell="create_potion_ointment" level="6" />
<entry spell="create_potion_p3" level="7" />
<entry spell="create_potion_p14" level="8" />
<entry spell="create_potion_healing" level="8" />
<entry spell="create_potion_p13" level="9" />
<entry spell="create_roi" level="7" />
<entry spell="create_aots" level="6" />

View File

@ -7,7 +7,7 @@
<entry spell="create_potion_peasantblood" level="5" />
<entry spell="create_potion_ointment" level="6" />
<entry spell="create_potion_p3" level="7" />
<entry spell="create_potion_p14" level="8" />
<entry spell="create_potion_healing" level="8" />
<entry spell="create_potion_p13" level="9" />
<entry spell="create_roi" level="7" />
<entry spell="create_aots" level="6" />

View File

@ -421,7 +421,7 @@
<resource name="h20" amount="1" cost="linear"/><!-- Schneekristall -->
<resource name="h9" amount="1" cost="linear"/><!-- Wasserfinder -->
</spell>
<spell name="create_potion_p14" ship="true" rank="5" variable="true">
<spell name="create_potion_healing" ship="true" rank="5" variable="true">
<!-- Heiltrank -->
<resource name="aura" amount="5" cost="linear"/>
<resource name="h0" amount="1" cost="linear"/><!-- Flachwurz -->

View File

@ -197,7 +197,7 @@
<text locale="de">Braue Elixier der Macht</text>
<text locale="en">brew elixir of power</text>
</string>
<string name="create_potion_p14">
<string name="create_potion_healing">
<text locale="de">Braue Heiltrank</text>
<text locale="en">brew healing potion</text>
</string>
@ -264,7 +264,7 @@
<text locale="en">Just like with the knowledge about death, the peasants feel uncomfortable with the knowledge about monsters. A few warriors though, who have already faced these creatures in combat, found that the monsters blood had an invigourating effect on them. There is talk about some warriors who bathed in the blood of the slain monsters to take up their strength. But this effect ends soon, and only occurs with fresh blood. As no one has time to quickly slay a wyrm before attacking their neighbors, a way had to be found to make the effect last longer. After lots of experiments that cost the life of lots of good warriors who had to constantly bring in fresh dragon blood, Manasouf the black finally found a way. Originally a closely guarded secret, the recipe is now known in all lands. First, the hardened dragon blood needs to be melted in hot tin. After that, the magician binds the spirit of the dragon to its blood once again. It can not find eternal rest until the last bit of blood has been used. </text>
<text locale="de">Ebenso wie das Wissen über den Tod ist das Wissen über gewisse Monster bei der abergläubigen Bevölkerung nicht gerne gesehen. Einige wenige Krieger jedoch, die diesen Kreaturen schon mal im Kampf gegenüberstanden, haben entdeckt, dass deren Blut eine belebende Wirkung auf sie hatte. So soll es schon Krieger gegeben haben, die im Blut der erschlagenen Monster badeten, um deren Stärke in sich aufzunehmen. Diese Wirkung verfliegt jedoch rasch und wirkt nur bei frischen Blut. Da niemand vor dem Kampf gegen seinen Nachbarn die Zeit hat, schnell noch einen Wyrm zu erschlagen, musste ein Weg gefunden werden, die Wirkung haltbar zu machen. Manasouf dem Schwarzen gelang dies nach zahlreichen Experimenten, die das Leben vieler guter Männer kosteten, welche ständig neues Drachenblut für seine Versuche beschaffen mussten. Ursprünglich ein streng gehütetes Geheimnis ist das Rezept inzwischen im ganzen Land bekannt. Zunächst muss geronnenes Drachenblut in heißem Zinn verflüssigt werden. Anschließend wird der Geist des erschlagenen Drachen in der Geisterebene wieder an sein Blut gebunden und kann so lange nicht in Frieden ruhen, bis das letzte bisschen seines Blutes verbraucht wurde.</text>
</string>
<string name="create_potion_p14">
<string name="create_potion_healing">
<text locale="en">Some mages research death's secrets until they can bring the dead back to life. But those who are brought back are often only shadows of ther former self and turn against their erstwhile friends. But those mages that study life and its iteraction with death find a possibility to bring the deceased back as their original selves. A drawback is that this is only possible in the very first minutes after death. As even mages can not be everywhere at the same time, a way had to be found to give this ability to helpers. All healers who tried to learn this from the mages failed, though, until one of those healers was backstabbingly killed. In the moment of his death he used the knowledge gained and was able to have his murderer executed the following day. The potion he designed has to be blessed by a magician before usage at any given time. This potion gives four people (or one person four times) a 50% chance to survive an otherwise deadly wound. It is used automatically by the victom.</text>
<text locale="de">Manche Magier erforschen den Tod, bis sie Verstorbene wieder ins Leben zurück bringen können. Diese sind jedoch meist bösartig und nur noch Schatten ihres früheren Selbst. Diejenigen jedoch, die sich intensiv mit dem Leben und seiner Kombination mit dem Tod beschäftigen, finden eine Möglichkeit, Verstorbene in ihrer wahren Gestalt zurück zu rufen. Dies ist allerdings nur wenige Minuten nach dem Tod möglich. Da selbst Magier nicht überall gleichzeitig sein können, musste ein Weg gefunden werden, diese Fähigkeit auf andere zu übertragen. Alle Versuche, dies Feldschern beizubringen, scheiterten jedoch, bis einer dieser Feldscher von einem Widersacher hinterrücks ermordet wurde. Im Moment seines Todes wandte er sein erworbenes Wissen an und konnte tags darauf den Übeltäter wegen Mordes hinrichten lassen. Der von ihm entwickelte magische Trank muss jedoch von einem der Magie des Lebens Kundigen gesegnet werden, um seine volle Wirkung zu entfalten. Ein solcher Trank gibt vier Männern (oder einem Mann viermal) im Kampf eine Chance von 50%, sonst tödliche Wunden zu überleben. Der Trank wird von ihnen automatisch bei Verletzung angewandt.</text>
</string>

View File

@ -55,8 +55,8 @@ function create_potion_p3(r, mage, level, force)
end
-- Heiltrank
function create_potion_p14(r, mage, level, force)
return create_potion(mage, level, "p14", force)
function create_potion_healing(r, mage, level, force)
return create_potion(mage, level, "healing", force)
end
-- Elixier der Macht

View File

@ -129,12 +129,12 @@ function test_use_healing_potion()
assert_equal(600, u.hp)
u.hp = 100
turn_begin()
u:add_item("p14", 1)
u:add_item("healing", 1)
u:clear_orders()
u:add_order("BENUTZEN 1 Heiltrank")
turn_process()
assert_equal(530, u.hp)
assert_equal(0, u:get_item("p14"))
assert_equal(0, u:get_item("healing"))
assert_equal(1, f:count_msg_type('use_item'))
turn_end()
end
@ -150,13 +150,13 @@ function test_use_healing_potion_multi_units()
u.hp = 400
u1.hp = 400
turn_begin()
u:add_item("p14", 1)
u:add_item("healing", 1)
u:clear_orders()
u:add_order("BENUTZEN 1 Heiltrank")
turn_process()
assert_equal(600, u.hp)
assert_equal(600, u1.hp)
assert_equal(0, u:get_item("p14"))
assert_equal(0, u:get_item("healing"))
turn_end()
end
@ -168,12 +168,12 @@ function test_use_multiple_healing_potions()
assert_equal(1200, u.hp)
u.hp = 400
turn_begin()
u:add_item("p14", 2)
u:add_item("healing", 2)
u:clear_orders()
u:add_order("BENUTZEN 2 Heiltrank")
turn_process()
assert_equal(1200, u.hp)
assert_equal(0, u:get_item("p14"))
assert_equal(0, u:get_item("healing"))
turn_end()
end

View File

@ -52,7 +52,6 @@ extern "C" {
/* Stufe 4 */
P_PEOPLE,
P_WAHRHEIT,
P_MACHT,
P_HEAL,
MAX_POTIONS
};

View File

@ -492,7 +492,7 @@ void register_itemfunctions(void)
register_item_use(use_foolpotion, "use_p7");
register_item_use(use_bloodpotion, "use_peasantblood");
register_item_use(use_ointment, "use_ointment");
register_item_use(use_healing_potion, "use_p14");
register_item_use(use_healing_potion, "use_healing");
register_item_use(use_power_elixir, "use_p13");
register_item_use(use_warmthpotion, "use_nestwarmth");
}

View File

@ -206,12 +206,13 @@ resource_type *rt_get_or_create(const char *name) {
static const char *it_aliases[][2] = {
{ "Runenschwert", "runesword" },
{ "p12", "truthpotion" },
{ "p1", "goliathwater" },
{ "p2", "lifepotion" },
{ "p4", "ointment" },
{ "p5", "peasantblood" },
{ "p8", "nestwarmth" },
{ "p14", "healing" },
{ "p12", "truthpotion" },
{ "diamond", "adamantium" },
{ "diamondaxe", "adamantiumaxe" },
{ "diamondplate", "adamantiumplate" },
@ -226,13 +227,18 @@ static const char *it_alias(const char *zname)
if (strcmp(it_aliases[i][0], zname) == 0)
return it_aliases[i][1];
}
return zname;
return NULL;
}
item_type *it_find(const char *zname)
{
resource_type *result = rt_find(zname);
if (!result) {
const char *name = it_alias(zname);
resource_type *result = rt_find(name);
if (name) {
result = rt_find(name);
}
}
return result ? result->itype : 0;
}
@ -638,7 +644,7 @@ static void init_oldpotions(void)
{
const char *potionnames[MAX_POTIONS] = {
"p0", "goliathwater", "lifepotion", "p3", "ointment", "peasantblood", "p6",
"p7", "nestwarmth", "p9", "p10", "p11", "truthpotion", "p13", "p14"
"p7", "nestwarmth", "p9", "p10", "p11", "truthpotion", "healing"
};
int p;