forked from github/server
Sonnensegel macht +1 Geschwindigkeit.
This commit is contained in:
parent
00d0bbc3b6
commit
0bf8468210
|
@ -26,6 +26,8 @@
|
||||||
#include <util/functions.h>
|
#include <util/functions.h>
|
||||||
#include <util/rand.h>
|
#include <util/rand.h>
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
/* BEGIN studypotion */
|
/* BEGIN studypotion */
|
||||||
#define MAXGAIN 15
|
#define MAXGAIN 15
|
||||||
static int
|
static int
|
||||||
|
@ -65,36 +67,26 @@ use_studypotion(struct unit * u, const struct item_type * itype, int amount, str
|
||||||
/* END studypotion */
|
/* END studypotion */
|
||||||
|
|
||||||
/* BEGIN speedsail */
|
/* BEGIN speedsail */
|
||||||
|
#define SPEEDSAIL_EFFECT 1
|
||||||
static int
|
static int
|
||||||
use_speedsail(struct unit * u, const struct item_type * itype, int amount, struct order * ord)
|
use_speedsail(struct unit * u, const struct item_type * itype, int amount, struct order * ord)
|
||||||
{
|
{
|
||||||
#ifdef SPEEDAIL_ENABLED
|
curse *c;
|
||||||
struct plane * p = rplane(u->region);
|
variant effect;
|
||||||
/* disabled because of abuse */
|
ship * sh = u->ship;
|
||||||
if (p!=NULL) {
|
if (!sh) {
|
||||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "use_realworld_only", ""));
|
cmistake(u, ord, 20, MSG_MOVE);
|
||||||
} else {
|
return -1;
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
unused(amount);
|
effect.i = SPEEDSAIL_EFFECT;
|
||||||
unused(itype);
|
c = create_curse(u, &sh->attribs, ct_find("shipspeedup"), 20, INT_MAX, effect, 0);
|
||||||
return EUNUSABLE;
|
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 */
|
/* END speedsail */
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
|
|
||||||
/* libc includes */
|
/* libc includes */
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <limits.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
@ -100,7 +101,7 @@ use_hornofdancing(struct unit * u, const struct item_type * itype,
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
useonother_trappedairelemental(struct unit * u, int shipId,
|
useonother_trappedairelemental(struct unit * u, int shipId,
|
||||||
const struct item_type * itype,
|
const struct item_type * itype,
|
||||||
int amount, struct order * ord)
|
int amount, struct order * ord)
|
||||||
{
|
{
|
||||||
|
@ -120,13 +121,12 @@ useonother_trappedairelemental(struct unit * u, int shipId,
|
||||||
}
|
}
|
||||||
|
|
||||||
effect.i = SPEEDUP;
|
effect.i = SPEEDUP;
|
||||||
c = create_curse(u, &sh->attribs, ct_find("shipspeedup"),
|
c = create_curse(u, &sh->attribs, ct_find("shipspeedup"), 20, INT_MAX, effect, 0);
|
||||||
20, 999999, effect, 0);
|
|
||||||
curse_setflag(c, CURSE_NOAGE);
|
curse_setflag(c, CURSE_NOAGE);
|
||||||
|
|
||||||
ADDMSG(&u->faction->msgs, msg_message("trappedairelemental_success",
|
ADDMSG(&u->faction->msgs, msg_message("trappedairelemental_success",
|
||||||
"unit region command ship", u, u->region, ord, sh));
|
"unit region command ship", u, u->region, ord, sh));
|
||||||
|
|
||||||
itype->rtype->uchange(u, itype->rtype, -1);
|
itype->rtype->uchange(u, itype->rtype, -1);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -118,7 +118,7 @@ curse_age(attrib * a)
|
||||||
c->duration = 0;
|
c->duration = 0;
|
||||||
} else if (c->flag & CURSE_NOAGE) {
|
} else if (c->flag & CURSE_NOAGE) {
|
||||||
c->duration = 1;
|
c->duration = 1;
|
||||||
} else {
|
} else if (c->duration!=INT_MAX) {
|
||||||
c->duration = max(0, c->duration-1);
|
c->duration = max(0, c->duration-1);
|
||||||
}
|
}
|
||||||
return c->duration;
|
return c->duration;
|
||||||
|
|
|
@ -28,18 +28,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kernel", "common\kernel\ker
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
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}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modules", "common\modules\modules.vcproj", "{601CF164-F483-4DE7-8014-64BDD30680B5}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
|
@ -76,22 +64,20 @@ EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmtool", "eressea\gmtool.vcproj", "{57BA2AEE-5C65-4839-9294-C0FA2915A06C}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmtool", "eressea\gmtool.vcproj", "{57BA2AEE-5C65-4839-9294-C0FA2915A06C}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
{C14E3D2B-8189-4570-A4E3-9010C873E4FD} = {C14E3D2B-8189-4570-A4E3-9010C873E4FD}
|
{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}
|
{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}
|
||||||
|
{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}
|
{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}
|
||||||
|
{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}
|
{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}
|
||||||
|
{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}
|
||||||
|
{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}
|
{4C837BEC-A428-4287-84B3-8F8F9DE7FA00} = {4C837BEC-A428-4287-84B3-8F8F9DE7FA00}
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
|
@ -132,10 +118,6 @@ Global
|
||||||
{EDB0DE67-8215-4AF7-ACA1-F23CB11FF211}.Profile.Build.0 = Profile|Win32
|
{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.ActiveCfg = Release|Win32
|
||||||
{EDB0DE67-8215-4AF7-ACA1-F23CB11FF211}.Release.Build.0 = 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.ActiveCfg = Debug|Win32
|
||||||
{601CF164-F483-4DE7-8014-64BDD30680B5}.Debug.Build.0 = Debug|Win32
|
{601CF164-F483-4DE7-8014-64BDD30680B5}.Debug.Build.0 = Debug|Win32
|
||||||
{601CF164-F483-4DE7-8014-64BDD30680B5}.Profile.ActiveCfg = Profile|Win32
|
{601CF164-F483-4DE7-8014-64BDD30680B5}.Profile.ActiveCfg = Profile|Win32
|
||||||
|
|
|
@ -227,10 +227,11 @@
|
||||||
<message name="use_speedsail" section="events">
|
<message name="use_speedsail" section="events">
|
||||||
<type>
|
<type>
|
||||||
<arg name="unit" type="unit"/>
|
<arg name="unit" type="unit"/>
|
||||||
|
<arg name="speed" type="int"/>
|
||||||
</type>
|
</type>
|
||||||
<text locale="de">"$unit($unit) setzt ein Sonnensegel. Die Geschwindigkeit des Schiffes erhöht sich dramatisch."</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 greatly increased."</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 greatly increased."</text>
|
<text locale="en">"$unit($unit) sets a solar sail. The ship's speed is increased by $int($speed)."</text>
|
||||||
</message>
|
</message>
|
||||||
<message name="use_questkey_wrongregion" section="events">
|
<message name="use_questkey_wrongregion" section="events">
|
||||||
<type>
|
<type>
|
||||||
|
|
|
@ -15,7 +15,6 @@ local function create_ents(r, number)
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
-- this is old stuff. it's not active at the moment.
|
|
||||||
function spawn_ents()
|
function spawn_ents()
|
||||||
local r
|
local r
|
||||||
for r in regions() do
|
for r in regions() do
|
||||||
|
|
Loading…
Reference in New Issue