forked from github/server
Merge branch 'develop' of github.com:ennorehling/eressea into develop
This commit is contained in:
commit
da2b116ea9
|
@ -1852,7 +1852,7 @@ static void do_combatspell(troop at)
|
||||||
log_error("spell '%s' has no function.\n", sp->sname);
|
log_error("spell '%s' has no function.\n", sp->sname);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
level = cast_combatspell(at, sp, level, MagicPower(power));
|
level = cast_combatspell(at, sp, level, power);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1870,7 +1870,7 @@ static void do_extra_spell(troop at, const att * a)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
assert(a->level > 0);
|
assert(a->level > 0);
|
||||||
cast_combatspell(at, sp, a->level, MagicPower(a->level));
|
cast_combatspell(at, sp, a->level, a->level);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -525,7 +525,7 @@ static void unit_castspell(unit * u, const char *name, int level)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
castorder co;
|
castorder co;
|
||||||
create_castorder(&co, u, 0, sp, u->region, level, MagicPower((float)level), 0, 0, 0);
|
create_castorder(&co, u, 0, sp, u->region, level, (double)level, 0, 0, 0);
|
||||||
sp->cast(&co);
|
sp->cast(&co);
|
||||||
free_castorder(&co);
|
free_castorder(&co);
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,7 +118,8 @@ static float MagicRegeneration(void)
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
double MagicPower(double force) {
|
static double MagicPower(double force)
|
||||||
|
{
|
||||||
if (force > 0) {
|
if (force > 0) {
|
||||||
const char *str = get_param(global.parameters, "magic.power");
|
const char *str = get_param(global.parameters, "magic.power");
|
||||||
double value = str ? atof(str) : 1.0;
|
double value = str ? atof(str) : 1.0;
|
||||||
|
@ -1074,8 +1075,6 @@ spellpower(region * r, unit * u, const spell * sp, int cast_level, struct order
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
force = MagicPower(force);
|
|
||||||
|
|
||||||
return _max(force, 0);
|
return _max(force, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2073,7 +2072,7 @@ castorder *create_castorder(castorder * co, unit *caster, unit * familiar, const
|
||||||
co->_familiar = familiar;
|
co->_familiar = familiar;
|
||||||
co->sp = sp;
|
co->sp = sp;
|
||||||
co->level = lev;
|
co->level = lev;
|
||||||
co->force = force;
|
co->force = MagicPower(force);
|
||||||
co->_rtarget = r ? r : (familiar ? familiar->region : (caster ? caster->region : 0));
|
co->_rtarget = r ? r : (familiar ? familiar->region : (caster ? caster->region : 0));
|
||||||
co->distance = range;
|
co->distance = range;
|
||||||
co->order = copy_order(ord);
|
co->order = copy_order(ord);
|
||||||
|
@ -2821,7 +2820,7 @@ void magic(void)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
co->force = spellpower(target_r, u, sp, co->level, ord);
|
co->force = MagicPower(spellpower(target_r, u, sp, co->level, ord));
|
||||||
/* die Stärke kann durch Antimagie auf 0 sinken */
|
/* die Stärke kann durch Antimagie auf 0 sinken */
|
||||||
if (co->force <= 0) {
|
if (co->force <= 0) {
|
||||||
co->force = 0;
|
co->force = 0;
|
||||||
|
|
|
@ -360,7 +360,6 @@ extern "C" {
|
||||||
extern void write_spells(struct quicklist *slist, struct storage *store);
|
extern void write_spells(struct quicklist *slist, struct storage *store);
|
||||||
extern void read_spells(struct quicklist **slistp, magic_t mtype,
|
extern void read_spells(struct quicklist **slistp, magic_t mtype,
|
||||||
struct storage *store);
|
struct storage *store);
|
||||||
double MagicPower(double force);
|
|
||||||
|
|
||||||
extern struct spellbook * get_spellbook(const char * name);
|
extern struct spellbook * get_spellbook(const char * name);
|
||||||
extern void free_spellbooks(void);
|
extern void free_spellbooks(void);
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include "study.h"
|
#include "study.h"
|
||||||
|
|
||||||
|
#include <kernel/config.h>
|
||||||
#include <kernel/unit.h>
|
#include <kernel/unit.h>
|
||||||
#include <kernel/faction.h>
|
#include <kernel/faction.h>
|
||||||
#include <kernel/order.h>
|
#include <kernel/order.h>
|
||||||
|
@ -26,6 +27,7 @@ static void setup_study(study_fixture *fix, skill_t sk) {
|
||||||
|
|
||||||
assert(fix);
|
assert(fix);
|
||||||
test_cleanup();
|
test_cleanup();
|
||||||
|
set_param(&global.parameters, "study.random_progress", "0");
|
||||||
test_create_world();
|
test_create_world();
|
||||||
r = test_create_region(0, 0, 0);
|
r = test_create_region(0, 0, 0);
|
||||||
f = test_create_faction(0);
|
f = test_create_faction(0);
|
||||||
|
|
Loading…
Reference in New Issue