Sonnensegel macht +1 Geschwindigkeit.

This commit is contained in:
Enno Rehling 2006-11-05 20:14:07 +00:00
parent 00d0bbc3b6
commit 0bf8468210
6 changed files with 34 additions and 60 deletions

View File

@ -26,6 +26,8 @@
#include <util/functions.h>
#include <util/rand.h>
#include <limits.h>
/* BEGIN studypotion */
#define MAXGAIN 15
static int
@ -65,36 +67,26 @@ use_studypotion(struct unit * u, const struct item_type * itype, int amount, str
/* END studypotion */
/* BEGIN speedsail */
#define SPEEDSAIL_EFFECT 1
static int
use_speedsail(struct unit * u, const struct item_type * itype, int amount, struct order * ord)
{
#ifdef SPEEDAIL_ENABLED
struct plane * p = rplane(u->region);
/* disabled because of abuse */
if (p!=NULL) {
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "use_realworld_only", ""));
} else {
if (u->ship) {
attrib * a = a_find(u->ship->attribs, &at_speedup);
if (a==NULL) {
a = a_add(&u->ship->attribs, a_new(&at_speedup));
a->data.sa[0] = 50; /* speed */
a->data.sa[1] = 50; /* decay */
ADDMSG(&u->faction->msgs, msg_message("use_speedsail", "unit", u));
/* Ticket abziehen */
i_change(&u->items, itype, -1);
return 0;
} else {
cmistake(u, ord, 211, MSG_EVENT);
}
} else {
cmistake(u, ord, 144, MSG_EVENT);
}
curse *c;
variant effect;
ship * sh = u->ship;
if (!sh) {
cmistake(u, ord, 20, MSG_MOVE);
return -1;
}
#endif
unused(amount);
unused(itype);
return EUNUSABLE;
effect.i = SPEEDSAIL_EFFECT;
c = create_curse(u, &sh->attribs, ct_find("shipspeedup"), 20, INT_MAX, effect, 0);
curse_setflag(c, CURSE_NOAGE);
ADDMSG(&u->faction->msgs, msg_message("use_speedsail", "unit speed", u, SPEEDSAIL_EFFECT));
itype->rtype->uchange(u, itype->rtype, -1);
return 0;
}
/* END speedsail */

View File

@ -33,6 +33,7 @@
/* libc includes */
#include <assert.h>
#include <limits.h>
#include <string.h>
#include <stdlib.h>
@ -100,7 +101,7 @@ use_hornofdancing(struct unit * u, const struct item_type * itype,
static int
useonother_trappedairelemental(struct unit * u, int shipId,
useonother_trappedairelemental(struct unit * u, int shipId,
const struct item_type * itype,
int amount, struct order * ord)
{
@ -120,13 +121,12 @@ useonother_trappedairelemental(struct unit * u, int shipId,
}
effect.i = SPEEDUP;
c = create_curse(u, &sh->attribs, ct_find("shipspeedup"),
20, 999999, effect, 0);
c = create_curse(u, &sh->attribs, ct_find("shipspeedup"), 20, INT_MAX, effect, 0);
curse_setflag(c, CURSE_NOAGE);
ADDMSG(&u->faction->msgs, msg_message("trappedairelemental_success",
"unit region command ship", u, u->region, ord, sh));
itype->rtype->uchange(u, itype->rtype, -1);
return 0;

View File

@ -118,7 +118,7 @@ curse_age(attrib * a)
c->duration = 0;
} else if (c->flag & CURSE_NOAGE) {
c->duration = 1;
} else {
} else if (c->duration!=INT_MAX) {
c->duration = max(0, c->duration-1);
}
return c->duration;

View File

@ -28,18 +28,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kernel", "common\kernel\ker
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mapper", "mapper\mapper.vcproj", "{17F83AAB-352D-4F68-ADA6-09F36D86826F}"
ProjectSection(ProjectDependencies) = postProject
{C14E3D2B-8189-4570-A4E3-9010C873E4FD} = {C14E3D2B-8189-4570-A4E3-9010C873E4FD}
{EF495253-2EEC-4F83-B6C0-D651F88B2198} = {EF495253-2EEC-4F83-B6C0-D651F88B2198}
{1D80D05F-BCF5-4971-8F06-D9581FD3B1F4} = {1D80D05F-BCF5-4971-8F06-D9581FD3B1F4}
{601CF164-F483-4DE7-8014-64BDD30680B5} = {601CF164-F483-4DE7-8014-64BDD30680B5}
{EDB0DE67-8215-4AF7-ACA1-F23CB11FF211} = {EDB0DE67-8215-4AF7-ACA1-F23CB11FF211}
{0EE778AB-8445-40DB-8F65-6BE378A91B97} = {0EE778AB-8445-40DB-8F65-6BE378A91B97}
{330712B5-8B27-4B17-B3CF-7A02CC0F93C3} = {330712B5-8B27-4B17-B3CF-7A02CC0F93C3}
{4C837BEC-A428-4287-84B3-8F8F9DE7FA00} = {4C837BEC-A428-4287-84B3-8F8F9DE7FA00}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "common\modules\modules.vcproj", "{601CF164-F483-4DE7-8014-64BDD30680B5}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
@ -76,22 +64,20 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmtool", "eressea\gmtool.vcproj", "{57BA2AEE-5C65-4839-9294-C0FA2915A06C}"
ProjectSection(ProjectDependencies) = postProject
{C14E3D2B-8189-4570-A4E3-9010C873E4FD} = {C14E3D2B-8189-4570-A4E3-9010C873E4FD}
{EF495253-2EEC-4F83-B6C0-D651F88B2198} = {EF495253-2EEC-4F83-B6C0-D651F88B2198}
{1D80D05F-BCF5-4971-8F06-D9581FD3B1F4} = {1D80D05F-BCF5-4971-8F06-D9581FD3B1F4}
{601CF164-F483-4DE7-8014-64BDD30680B5} = {601CF164-F483-4DE7-8014-64BDD30680B5}
{EDB0DE67-8215-4AF7-ACA1-F23CB11FF211} = {EDB0DE67-8215-4AF7-ACA1-F23CB11FF211}
{0EE778AB-8445-40DB-8F65-6BE378A91B97} = {0EE778AB-8445-40DB-8F65-6BE378A91B97}
{330712B5-8B27-4B17-B3CF-7A02CC0F93C3} = {330712B5-8B27-4B17-B3CF-7A02CC0F93C3}
{4C837BEC-A428-4287-84B3-8F8F9DE7FA00} = {4C837BEC-A428-4287-84B3-8F8F9DE7FA00}
EndProjectSection
ProjectSection(ProjectDependencies) = postProject
{C14E3D2B-8189-4570-A4E3-9010C873E4FD} = {C14E3D2B-8189-4570-A4E3-9010C873E4FD}
{EF495253-2EEC-4F83-B6C0-D651F88B2198} = {EF495253-2EEC-4F83-B6C0-D651F88B2198}
{EF495253-2EEC-4F83-B6C0-D651F88B2198} = {EF495253-2EEC-4F83-B6C0-D651F88B2198}
{1D80D05F-BCF5-4971-8F06-D9581FD3B1F4} = {1D80D05F-BCF5-4971-8F06-D9581FD3B1F4}
{1D80D05F-BCF5-4971-8F06-D9581FD3B1F4} = {1D80D05F-BCF5-4971-8F06-D9581FD3B1F4}
{601CF164-F483-4DE7-8014-64BDD30680B5} = {601CF164-F483-4DE7-8014-64BDD30680B5}
{601CF164-F483-4DE7-8014-64BDD30680B5} = {601CF164-F483-4DE7-8014-64BDD30680B5}
{EDB0DE67-8215-4AF7-ACA1-F23CB11FF211} = {EDB0DE67-8215-4AF7-ACA1-F23CB11FF211}
{EDB0DE67-8215-4AF7-ACA1-F23CB11FF211} = {EDB0DE67-8215-4AF7-ACA1-F23CB11FF211}
{0EE778AB-8445-40DB-8F65-6BE378A91B97} = {0EE778AB-8445-40DB-8F65-6BE378A91B97}
{0EE778AB-8445-40DB-8F65-6BE378A91B97} = {0EE778AB-8445-40DB-8F65-6BE378A91B97}
{330712B5-8B27-4B17-B3CF-7A02CC0F93C3} = {330712B5-8B27-4B17-B3CF-7A02CC0F93C3}
{330712B5-8B27-4B17-B3CF-7A02CC0F93C3} = {330712B5-8B27-4B17-B3CF-7A02CC0F93C3}
{4C837BEC-A428-4287-84B3-8F8F9DE7FA00} = {4C837BEC-A428-4287-84B3-8F8F9DE7FA00}
{4C837BEC-A428-4287-84B3-8F8F9DE7FA00} = {4C837BEC-A428-4287-84B3-8F8F9DE7FA00}
EndProjectSection
EndProject
@ -132,10 +118,6 @@ Global
{EDB0DE67-8215-4AF7-ACA1-F23CB11FF211}.Profile.Build.0 = Profile|Win32
{EDB0DE67-8215-4AF7-ACA1-F23CB11FF211}.Release.ActiveCfg = Release|Win32
{EDB0DE67-8215-4AF7-ACA1-F23CB11FF211}.Release.Build.0 = Release|Win32
{17F83AAB-352D-4F68-ADA6-09F36D86826F}.Debug.ActiveCfg = Debug|Win32
{17F83AAB-352D-4F68-ADA6-09F36D86826F}.Debug.Build.0 = Debug|Win32
{17F83AAB-352D-4F68-ADA6-09F36D86826F}.Profile.ActiveCfg = Profile|Win32
{17F83AAB-352D-4F68-ADA6-09F36D86826F}.Release.ActiveCfg = Release|Win32
{601CF164-F483-4DE7-8014-64BDD30680B5}.Debug.ActiveCfg = Debug|Win32
{601CF164-F483-4DE7-8014-64BDD30680B5}.Debug.Build.0 = Debug|Win32
{601CF164-F483-4DE7-8014-64BDD30680B5}.Profile.ActiveCfg = Profile|Win32

View File

@ -227,10 +227,11 @@
<message name="use_speedsail" section="events">
<type>
<arg name="unit" type="unit"/>
<arg name="speed" type="int"/>
</type>
<text locale="de">"$unit($unit) setzt ein Sonnensegel. Die Geschwindigkeit des Schiffes erhöht sich dramatisch."</text>
<text locale="fr">"$unit($unit) sets a solar sail. The ship's speed is greatly increased."</text>
<text locale="en">"$unit($unit) sets a solar sail. The ship's speed is greatly increased."</text>
<text locale="de">"$unit($unit) setzt ein Sonnensegel. Die Geschwindigkeit des Schiffes erhöht um $int($speed)."</text>
<text locale="fr">"$unit($unit) sets a solar sail. The ship's speed is increased by $int($speed)."</text>
<text locale="en">"$unit($unit) sets a solar sail. The ship's speed is increased by $int($speed)."</text>
</message>
<message name="use_questkey_wrongregion" section="events">
<type>

View File

@ -15,7 +15,6 @@ local function create_ents(r, number)
return nil
end
-- this is old stuff. it's not active at the moment.
function spawn_ents()
local r
for r in regions() do