Typecasts Gefixt.
Teilweise ausgebaut, teilweise zu deklarativen Casts geaendert bzw.
deklarative Casts hinzugefuegt.
Weiterhin ein paar call_other() auf this_object() ausgebaut.
Change-Id: I0c493914c41c53e884aaf80b01db600aeb6508e9
diff --git a/items/seil.c b/items/seil.c
index 880d022..9b775d8 100644
--- a/items/seil.c
+++ b/items/seil.c
@@ -51,7 +51,7 @@
if (tied_to_ob)
return Name(WER)+", "+artikel+" an "
- + (tied_name?tied_name:(string)(tied_to_ob->name(WEM)))
+ + (tied_name?tied_name:(({string})tied_to_ob->name(WEM)))
+ " festgebunden ist";
return Name(WER);
@@ -129,11 +129,11 @@
if (!(tied_name=call_other(ob, "tie", t2)))
{
- if(ob->QueryProp(P_INVIS)) return 0;
+ if(({int})ob->QueryProp(P_INVIS)) return 0;
if (ob != environment(this_player()))
{
- _notify_fail("Du kannst "+name(WER)+" nicht an "+ob->name(WEM)+
+ _notify_fail("Du kannst "+name(WER)+" nicht an "+({string})ob->name(WEM)+
" festbinden.\n");
return 0;
}
@@ -154,9 +154,9 @@
tied_to_ob = ob;
if (tied_to_ob != environment(this_player()) ||
- environment(this_player())->name()!=0 )
+ ({string})environment(this_player())->name()!=0 )
{
- tied_name = (string)(tied_to_ob->name(WEM));
+ tied_name = (({string})tied_to_ob->name(WEM));
}
else
{
@@ -175,13 +175,15 @@
else
{
write("Du bindest "+name(WER)+" an " + tied_name + " fest.\n");
- say(this_player()->name(WER) + " bindet "+name(WER)+" an "
+ say(({string})this_player()->name(WER) + " bindet "+name(WER)+" an "
+ tied_name + " fest.\n");
}
// den object mitteilen, an wen es gebunden ist.
- if(tied_to_ob->QueryProp(P_TIED)==0) tied_to_ob->SetProp(P_TIED,([]) );
- tied_to_ob->SetProp(P_TIED,tied_to_ob->QueryProp(P_TIED)+([this_object():
+ if(({mapping})tied_to_ob->QueryProp(P_TIED)==0)
+ ({mapping})tied_to_ob->SetProp(P_TIED,([]) );
+ ({mapping})tied_to_ob->SetProp(P_TIED,
+ ({mapping})tied_to_ob->QueryProp(P_TIED)+([this_object():
([
"player":this_player(),
"time" :time()
@@ -225,15 +227,15 @@
else
{
write("Du bindest "+name(WER)+" los.\n");
- say(this_player()->name()+" bindet "+name(WER)+" los.\n");
+ say(({string})this_player()->name()+" bindet "+name(WER)+" los.\n");
}
- tied_map=([])+tied_to_ob->QueryProp(P_TIED);
+ tied_map=([])+({mapping})tied_to_ob->QueryProp(P_TIED);
tied_map=m_copy_delete(tied_map,this_object());
- tied_to_ob->SetProp(P_TIED,tied_map);
+ ({mapping})tied_to_ob->SetProp(P_TIED,tied_map);
- tied_to_ob = (object) 0;
+ tied_to_ob = 0;
return 1;
}
diff --git a/obj/tools/MGtool.c b/obj/tools/MGtool.c
index e5c1497..4656d68 100644
--- a/obj/tools/MGtool.c
+++ b/obj/tools/MGtool.c
@@ -137,7 +137,7 @@
nostore++;
if(MODE(MODE_ECHO))
WLN("Doing: "+str);
- i=(int)cloner->command_me(str);
+ i=({int})cloner->command_me(str);
nostore--;
return i;
}
@@ -288,9 +288,9 @@
str="Ein Teddy (stumm)";
else
{
- if(str=(string)obj->QueryProp(P_INT_LONG))
+ if(str=({string})obj->QueryProp(P_INT_LONG))
;
- else if(str=(string)obj->QueryProp(P_LONG))
+ else if(str=({string})obj->QueryProp(P_LONG))
;
else
str="- no long description -\n";
@@ -329,8 +329,8 @@
str=capitalize(getuid(obj));
else
{
- if(!((str=(string)obj->QueryProp(P_INT_SHORT))||
- (str=(string)obj->QueryProp(P_SHORT))))
+ if(!((str=({string})obj->QueryProp(P_INT_SHORT))||
+ (str=({string})obj->QueryProp(P_SHORT))))
if(is_player(obj))
str=CRNAME(obj)+" (invisible)";
else
@@ -408,7 +408,7 @@
{
int tmp;
string *flags;
- tmp=(int)ob->Query(key,1);
+ tmp=({mixed})ob->Query(key,1);
flags=({});
tmp&SAVE ? flags+=({"SAV"}) : flags+=({" "});
tmp&PROTECTED ? flags+=({"PRO"}) : flags+=({" "});
@@ -431,7 +431,7 @@
static mixed propmethods(string key, object ob)
{
- return (mixed)ob->Query(key,2);
+ return ({mixed})ob->Query(key,2);
}
static void dprop3(string key, mixed data, object ob)
@@ -450,13 +450,13 @@
PIPE_DELETE(pipe_of);
switch (flag) {
case 0:
- walk_mapping(((mapping *)(obj->__query_properties()))[0],#'dprop,obj); //')
+ walk_mapping(((({mixed*})obj->__query_properties()))[0],#'dprop,obj);
break;
case 1:
- walk_mapping(((mapping *)(obj->__query_properties()))[0],#'dprop2,obj); //')
+ walk_mapping(((({mixed*})obj->__query_properties()))[0],#'dprop2,obj);
break;
case 2:
- walk_mapping(((mapping *)(obj->__query_properties()))[0],#'dprop3,obj); //')
+ walk_mapping(((({mixed*})obj->__query_properties()))[0],#'dprop3,obj);
break;
}
}
@@ -474,7 +474,7 @@
if(!(obj1&&obj2))
return FALSE;
oldenv=ENV(obj1);
- err=(int)obj1->move(obj2, M_SILENT|M_NOCHECK);
+ err=({int})obj1->move(obj2, M_SILENT|M_NOCHECK);
if(!silent)
switch(err)
{
@@ -513,7 +513,7 @@
{
if(!obj || !this_object())
return;
- catch(obj->remove());
+ catch(({int})obj->remove());
if(objectp(obj) && !query_once_interactive(obj))
destruct(obj);
}
@@ -935,7 +935,7 @@
if(!obj)
return NULL;
- i=(int)obj->QueryProp(P_AGE);
+ i=({int})obj->QueryProp(P_AGE);
str=" "+ARIGHT(""+(i/43200), 4, ".");
i-=(i/43200)*43200;
return str+":"+ARIGHT(""+(i/1800), 2, "0");
@@ -947,7 +947,7 @@
if((uid=getuid(who))==ROOTID &&
object_name(who)[0..7]=="/secure/" &&
- (lname=(string)who->loginname()))
+ (lname=({string})who->loginname()))
return CAP(lname);
return CAP(uid);
}
@@ -959,12 +959,12 @@
str=ARIGHT(""+LEVEL(obj) , 3, " ");
str+=ALEFT(" "+crname(obj)+" ", 12, ".");
str+=PlayerAge(obj);
- str+=((int)obj->QueryProp(P_GENDER)==1 ? " m " : " f ");
- str+=(obj->QueryProp(P_FROG)) ? "f" : ".";
- str+=(obj->QueryProp(P_GHOST)) ? "g" : ".";
- str+=(obj->QueryProp(P_INVIS)) ? "i" : ".";
+ str+=(({int})obj->QueryProp(P_GENDER)==1 ? " m " : " f ");
+ str+=(({int})obj->QueryProp(P_FROG)) ? "f" : ".";
+ str+=(({int})obj->QueryProp(P_GHOST)) ? "g" : ".";
+ str+=(({int})obj->QueryProp(P_INVIS)) ? "i" : ".";
str+=(query_editing(obj)||query_input_pending(obj) ? "e" : ".");
- str+=(obj->QueryProp(P_AWAY)) ? "a" : ".";
+ str+=(({string})obj->QueryProp(P_AWAY)) ? "a" : ".";
str+=" "+PlayerIdle(obj)+" ";
str+=(tmp=ENV(obj)) ? ObjFile(tmp) : "- fabric of space -";
return str;
@@ -975,7 +975,7 @@
string pre;
pre=(flag) ? ALEFT(crname(obj)+" ", 12, ".")+" " : "";
- return pre+"mail: "+obj->QueryProp(P_MAILADDR);
+ return pre+"mail: "+({string})obj->QueryProp(P_MAILADDR);
}
static string PlayerIP(object obj, int flag)
@@ -991,8 +991,9 @@
string tmp, pre;
pre=(flag) ? ALEFT(crname(obj)+" ", 12, ".")+" " : "";
- pre=pre+"race: "+ALEFT(obj->QueryProp(P_RACE)+" ", 10, ".")+" guild: ";
- tmp=(string)obj->QueryProp(P_GUILD);
+ pre=pre+"race: "+ALEFT(({string})obj->QueryProp(P_RACE)+" ", 10, ".")+
+ " guild: ";
+ tmp=({string})obj->QueryProp(P_GUILD);
return tmp ? pre+tmp : pre+"- none -";
}
@@ -1000,7 +1001,8 @@
{
string pre=(flag) ? ALEFT(crname(obj)+" ", 12, ".")+" " : "";
pre+="domainlord of: ";
- string *domains = master()->query_userlist(getuid(obj),USER_DOMAIN);
+ string *domains = ({string*})master()->query_userlist(getuid(obj),
+ USER_DOMAIN);
if(sizeof(domains))
pre += CountUp(domains, ", ", ", ");
return pre;
@@ -1011,15 +1013,15 @@
string pre;
pre=(flag) ? ALEFT(crname(obj)+" ", 12, ".")+" " : "";
- pre+="hp="+ARIGHT(obj->QueryProp(P_HP), 3, "0");
- pre+="/"+ARIGHT(obj->QueryProp(P_MAX_HP), 3, "0");
- pre+=" sp="+ARIGHT(obj->QueryProp(P_SP), 3, "0");
- pre+="/"+ARIGHT(obj->QueryProp(P_MAX_SP), 3, "0");
- pre+=" food="+ARIGHT(obj->QueryProp(P_FOOD), 3, "0");
- pre+="/"+ARIGHT(obj->QueryProp(P_MAX_FOOD), 3, "0");
- pre+=" drink="+ARIGHT(obj->QueryProp(P_DRINK), 3, "0");
- pre+="/"+ARIGHT(obj->QueryProp(P_MAX_DRINK), 3, "0");
- pre+=" exps="+obj->QueryProp(P_XP);
+ pre+="hp="+ARIGHT(({int})obj->QueryProp(P_HP), 3, "0");
+ pre+="/"+ARIGHT(({int})obj->QueryProp(P_MAX_HP), 3, "0");
+ pre+=" sp="+ARIGHT(({int})obj->QueryProp(P_SP), 3, "0");
+ pre+="/"+ARIGHT(({int})obj->QueryProp(P_MAX_SP), 3, "0");
+ pre+=" food="+ARIGHT(({int})obj->QueryProp(P_FOOD), 3, "0");
+ pre+="/"+ARIGHT(({int})obj->QueryProp(P_MAX_FOOD), 3, "0");
+ pre+=" drink="+ARIGHT(({int})obj->QueryProp(P_DRINK), 3, "0");
+ pre+="/"+ARIGHT(({int})obj->QueryProp(P_MAX_DRINK), 3, "0");
+ pre+=" exps="+({int})obj->QueryProp(P_XP);
return pre;
}
@@ -1042,7 +1044,7 @@
string pre;
pre=(flag) ? ALEFT(crname(obj)+" ", 12, ".")+" " : "";
- return pre+"cmdavg: "+(int)obj->_query_command_average();
+ return pre+"cmdavg: "+({int})obj->_query_command_average();
}
@@ -1132,7 +1134,7 @@
WDLN(crname(RTP)+" scanned you (short) ["+query_verb()+"] "+
(PREV ? ObjFile(PREV) : "[destructed object]"));
if( sh=Query(P_SHORT) ) return sh; // added by Rumata
- return cloner->name(WESSEN)+" "+TOOL_TITLE+" ["+
+ return ({string})cloner->name(WESSEN)+" "+TOOL_TITLE+" ["+
ctime(time())[11..18]+"]";
}
return TOOL_TITLE;
@@ -1201,7 +1203,7 @@
;
else
{
- if((string)args[0]!=TOOL_INTERNAL)
+ if(args[0]!=TOOL_INTERNAL)
{
WLN("*****************************");
WLN("*** NEW EDITION ***");
@@ -1209,8 +1211,8 @@
WLN("*** more information ***");
WLN("*****************************");
}
- modi=(int)args[1];
- morelines=(int)args[2];
+ modi=args[1];
+ morelines=args[2];
return;
}
W("(bad autoload, using default)\n");
@@ -1290,7 +1292,7 @@
{
if(!obj||!objectp(obj))
return;
- obj->move(ENV(cloner),M_NOCHECK|M_NO_SHOW);
+ ({int})obj->move(ENV(cloner),M_NOCHECK|M_NO_SHOW);
}
#define ACTIONS\
@@ -1444,7 +1446,7 @@
if(!verb||!sizeof(verb)||!GetFunc(verb,TRUE))
return FALSE;
- str=(string)this_player()->_unparsed_args();
+ str=({string})this_player()->_unparsed_args();
pipe_in=FALSE;
pipe_of=NULL;
pipe_ovr=TRUE;
@@ -1564,7 +1566,7 @@
#endif
if(str=="")
str=NULL;
- return fun?(int)call_other(ME,fun,str):FALSE;
+ return fun?({int})call_other(ME,fun,str):FALSE;
}
static string GetFunc(string verb, int test)
@@ -1577,7 +1579,7 @@
if(verb[0..0]!="x") // Assume all commands start with "x"
return 0;
- if (!(fun=(string)ACTIONS[verb,0])) { // Try exact hit first
+ if (!(fun=ACTIONS[verb,0])) { // Try exact hit first
key="";
len=sizeof(verb);
for (i=sizeof(keys=m_indices(ACTIONS))-1;i>=0;i--) {
@@ -1653,7 +1655,7 @@
void add_insert_hook()
{
if(objectp(cloner))
- cloner->HRegisterToHook(H_HOOK_INSERT, #'insert_hook,
+ ({int})cloner->HRegisterToHook(H_HOOK_INSERT, #'insert_hook,
H_HOOK_LIBPRIO(2), H_LISTENER, 0);
}
diff --git a/obj/tools/MGtool/toolcmd.c b/obj/tools/MGtool/toolcmd.c
index d37e1df..e2546c1 100644
--- a/obj/tools/MGtool/toolcmd.c
+++ b/obj/tools/MGtool/toolcmd.c
@@ -60,7 +60,7 @@
{
obj=find_object(LPC_FILE);
ru1=rusage();
- error=catch(res=(mixed)obj->eval(callobj, cloner, ENV(cloner)));
+ error=catch(res=obj->eval(callobj, cloner, ENV(cloner)));
ru2=rusage();
if(error)
W("Error: "+error[1..]);
@@ -183,7 +183,7 @@
TK("Xcd: str: "+(str?str:"(NULL)"));
if(!str)
{
- if(!(path=(string)cloner->QueryProp("start_home")))
+ if(!(path=cloner->QueryProp("start_home")))
path="/";
}
else if((dest=XFindObj(str,1)))
@@ -487,7 +487,7 @@
else
{
ru1=rusage();
- error=catch(res=(mixed)obj->eval(cloner, ENV(cloner)));
+ error=catch(res=obj->eval(cloner, ENV(cloner)));
ru2=rusage();
if(error)
W("Error: "+error[1..]);
@@ -952,7 +952,7 @@
if(!(daemon=load_object(LAG_O_DAEMON)))
lag=({-1.0,-1.0,-1.0});
else
- lag=(float *)daemon->read_lag_data();
+ lag=daemon->read_lag_data();
lags="Letzte 60 min: ";
if(lag[0]>=0.0)
{
@@ -1102,7 +1102,7 @@
else
{
ru1=rusage();
- error=catch(res=(mixed)obj->eval(cloner, ENV(cloner)));
+ error=catch(res=obj->eval(cloner, ENV(cloner)));
ru2=rusage();
if(error)
W("Error: "+error[1..]);
@@ -1266,12 +1266,12 @@
opt="";
else
opt=implode(strs[0..s-3], " ");
- if(!(dir="/"+(string)MASTER->valid_read(strs[s-2], geteuid(),
+ if(!(dir="/"+MASTER->valid_read(strs[s-2], geteuid(),
"get_dir", ME))) {
WDLN("No permission to open directory for reading");
return TRUE;
}
- if(!(file="/"+(string)MASTER->valid_write(strs[s-1], geteuid(),
+ if(!(file="/"+MASTER->valid_write(strs[s-1], geteuid(),
"write_file", ME))) {
WDLN("No permission to open script file for writing");
return TRUE;
@@ -1380,7 +1380,7 @@
}
else if(obj=XFindObj(str))
{
- if(xpr=(mapping)obj->__query_xprof_data__())
+ if(xpr=obj->__query_xprof_data__())
{
funcs=m_indices(xpr);
data=m_values(xpr);
diff --git a/obj/tools/MGtool/toollib.c b/obj/tools/MGtool/toollib.c
index fdf40b8..4f8e59f 100644
--- a/obj/tools/MGtool/toollib.c
+++ b/obj/tools/MGtool/toollib.c
@@ -115,7 +115,7 @@
case T_POINTER:
return "({"+implode(map(mix,"mixed_to_string",ME,lvl-1),",")+"})";
case T_OBJECT:
- return "["+short_path(object_name((object)mix))+"]";
+ return "["+short_path(object_name(mix))+"]";
case T_MAPPING:
s=sizeof(keys=m_indices(mix));
t=get_type_info(mix, 1);
diff --git a/p/daemon/finger.c b/p/daemon/finger.c
index 2af2975..6e42792 100644
--- a/p/daemon/finger.c
+++ b/p/daemon/finger.c
@@ -345,12 +345,12 @@
{
if (IS_WIZARD(this_player())) {
text+=capitalize(str)+" ist";
- switch((int)properties[P_SECOND_MARK]) {
+ switch(properties[P_SECOND_MARK]) {
case -1: text+=" unsichtbar markierte"
- +((int)properties[P_GENDER]!=FEMALE ? "r": "");
+ +(properties[P_GENDER]!=FEMALE ? "r": "");
break;
case 0: text+=" nicht namentlich markierte"
- +((int)properties[P_GENDER]!=FEMALE ? "r": "");
+ +(properties[P_GENDER]!=FEMALE ? "r": "");
break;
default:
}
@@ -359,14 +359,14 @@
text+=" ("+capitalize(h)+")";
text+=".\n";
}
- else if ((int)properties[P_SECOND_MARK]>0)
+ else if (properties[P_SECOND_MARK]>0)
{
text+=capitalize(str)+" ist Zweitspieler"+IN;
if (stringp(h))
text+=" ("+capitalize(h)+")";
text+=".\n";
}
- else if ((int)properties[P_SECOND_MARK]>-1)
+ else if (properties[P_SECOND_MARK]>-1)
text+=capitalize(str)+" ist Zweitspieler"+IN+".\n";
}
if (properties[P_DEADS])
diff --git a/p/service/padreic/mnpc/moving.c b/p/service/padreic/mnpc/moving.c
index 301b8aa..b5a0d34 100644
--- a/p/service/padreic/mnpc/moving.c
+++ b/p/service/padreic/mnpc/moving.c
@@ -271,24 +271,24 @@
{
// wenn ein VC existiert, prüfen ob dieser ParaObjecte unterstuetzt
// wenn ja, dann testen ob sich Raum laden laesst...
- if ((!catch(tmp=(int)call_other(vc,"NoParaObjects")) && (!tmp)) &&
+ if ((!catch(tmp=call_other(vc,"NoParaObjects")) && (!tmp)) &&
(!catch(call_other( fn, "???" ))))
dest=fn;
}
}
- res = (int)call_other(ME, "move", dest, M_NOCHECK);
+ res = call_other(ME, "move", dest, M_NOCHECK);
if (oldenv==environment())
return res;
// als erstes die Meldung fuer das Verlassen des Raumes...
if ( method & M_TPORT )
- textout = (string) QueryProp(P_MMSGOUT) || (string) QueryProp(P_MSGOUT);
+ textout = QueryProp(P_MMSGOUT) || QueryProp(P_MSGOUT);
else
{
- mout = explode( (string) QueryProp(P_MSGOUT) || "", "#" );
- textout = mout[0] || (string) QueryProp(P_MMSGOUT);
+ mout = explode( QueryProp(P_MSGOUT) || "", "#" );
+ textout = mout[0] || QueryProp(P_MMSGOUT);
}
if (stringp(textout))
@@ -308,9 +308,9 @@
// nun die Meldung für das "Betreten" des Raumes...
if ( method & M_TPORT )
- textin = (string) QueryProp(P_MMSGIN);
+ textin = QueryProp(P_MMSGIN);
else
- textin = (string) QueryProp(P_MSGIN);
+ textin = QueryProp(P_MSGIN);
if (stringp(textin))
{
diff --git a/room/orakel.c b/room/orakel.c
index 5419a99..061368a 100644
--- a/room/orakel.c
+++ b/room/orakel.c
@@ -76,8 +76,8 @@
int sps; // Stufenpunkte des Spielers
platt = this_player()->QueryProp(P_ATTRIBUTES);
- summe = (int)platt["int"] + (int)platt["con"] +
- (int)platt["dex"] + (int)platt["str"] - 4;
+ summe = platt["int"] + platt["con"] +
+ platt["dex"] + platt["str"] - 4;
summe += sizeof(this_player()->QueryProp(P_KNOWN_POTIONROOMS));
sps = this_player()->QueryProp(P_LEP);
diff --git a/secure/krautmaster.c b/secure/krautmaster.c
index cc84005..2c0dcba 100644
--- a/secure/krautmaster.c
+++ b/secure/krautmaster.c
@@ -1140,8 +1140,8 @@
raise_error(sprintf("make_potion() got invalid object in plant array "
"%.50O\n",plants));
- int* plantids = (int*)plants->QueryPlantId();
- int* qualities = (int*)plants->QueryProp(P_QUALITY);
+ int* plantids = plants->QueryPlantId();
+ int* qualities = plants->QueryProp(P_QUALITY);
return calculate_potion(plantids, qualities,
ZWEITIES->QueryFamilie(this_player()));
diff --git a/std/armour/wear.c b/std/armour/wear.c
index a870bd1..3615d43 100644
--- a/std/armour/wear.c
+++ b/std/armour/wear.c
@@ -47,7 +47,7 @@
foreach(object armour: armours)
{
- if (type==(armour->QueryProp(P_ARMOUR_TYPE)))
+ if (type==(({string})armour->QueryProp(P_ARMOUR_TYPE)))
{
// Ruestung vom gleichen Typ gefunden -> zurueckgeben
return armour;
@@ -75,14 +75,14 @@
object_name()));
}
- armours=(object*)PL->QueryProp(P_ARMOURS) - ({0});
+ armours=({object*})PL->QueryProp(P_ARMOURS) - ({0});
// Von jedem Ruestungstyp ausser AT_MISC kann man immer nur ein
// Teil tragen
if ( (type!=AT_MISC) && (res=TestType(armours)) && objectp(res)) {
msg(break_string(sprintf(
"Du traegst bereits %s als Schutz der Sorte %s.",
- res->name(WEN,1), type),78,
+ ({string})res->name(WEN,1), type),78,
(all?(Name(WER)+": "):0)), all);
return(-1);
}
@@ -91,7 +91,7 @@
// Ruestungstyp zu hohen Schutzwert koennen nicht angezogen werden
if ( (type==AT_ILLEGAL) || (QueryProp(P_AC)>VALID_ARMOUR_CLASS[type])) {
write("Ungueltiger Ruestungstyp, bitte Erzmagier verstaendigen.\n");
- "/p/daemon/ruestungen"->RegisterArmour();
+ ({void})"/p/daemon/ruestungen"->RegisterArmour();
return(-2);
}
@@ -99,7 +99,8 @@
// das gesetzte Limit verstossen, haben keine Wirkung bezueglich der
// Attribute. Dies gibt aber nur ne Meldung aus, angezogen werden darf sie
// trotzdem.
- if (mappingp(res=QueryProp(P_M_ATTR_MOD)) && PL->TestLimitViolation(res) ) {
+ if (mappingp(res=QueryProp(P_M_ATTR_MOD)) &&
+ ({int})PL->TestLimitViolation(res) ) {
write(break_string(sprintf(
"Irgendetwas an Deiner Ausruestung verhindert, dass Du Dich mit "
"%s so richtig wohl fuehlst.",name(WEM,1)),78,
@@ -114,16 +115,16 @@
protected void _informwear(int silent, int all) {
// Ruestungen koennen Resistenzen beeinflussen
- PL->AddResistanceModifier(QueryProp(P_RESISTANCE_STRENGTHS),
+ ({int})PL->AddResistanceModifier(QueryProp(P_RESISTANCE_STRENGTHS),
QueryProp(P_ARMOUR_TYPE));
// Ruestungen koennen Attribute aendern/blockieren. Also muessen diese
// nach dem Anziehen aktualisiert werden
- PL->register_modifier(ME);
- PL->UpdateAttributes();
+ ({void})PL->register_modifier(ME);
+ ({void})PL->UpdateAttributes();
// P_TOTAL_AC im Traeger updaten (fuer Query()s)
- PL->QueryProp(P_TOTAL_AC);
+ ({int})PL->QueryProp(P_TOTAL_AC);
// Alle Ruestungen werden im awmaster registriert, sobald sie von
// einem Spieler gezueckt werden
@@ -160,15 +161,15 @@
protected void _informunwear(object worn_by, int silent, int all) {
mixed res;
// Gesetzte Resistenzen loeschen
- worn_by->RemoveResistanceModifier(res=QueryProp(P_ARMOUR_TYPE));
+ ({void})worn_by->RemoveResistanceModifier(res=QueryProp(P_ARMOUR_TYPE));
// Ruestungen koennen Attribute aendern/blockieren. Also muessen diese
// nach dem Ausziehen aktualisiert werden
- worn_by->deregister_modifiers(ME);
- worn_by->UpdateAttributes();
+ ({void})worn_by->deregister_modifiers(ME);
+ ({void})worn_by->UpdateAttributes();
// P_TOTAL_AC im Traeger updaten
- worn_by->QueryProp(P_TOTAL_AC);
+ ({int})worn_by->QueryProp(P_TOTAL_AC);
// die geerbte Funktion aus der Kleindung gibt noch meldungen aus und ruft
// Informunwear().
@@ -248,7 +249,7 @@
// P_TOTAL_AC im Traeger updaten, wenn vorhanden
if (objectp(w=QueryProp(P_WORN)))
- w->QueryProp(P_TOTAL_AC);
+ ({int})w->QueryProp(P_TOTAL_AC);
// Rueckgabewert: Durchgefuehrte Aenderung an P_DAMAGE
return new_dam;
diff --git a/std/clothing/moving.c b/std/clothing/moving.c
index 1c103b5..3dad966 100644
--- a/std/clothing/moving.c
+++ b/std/clothing/moving.c
@@ -26,7 +26,7 @@
if (objectp(QueryProp(P_WORN)))
DoUnwear(method & (M_SILENT|M_NOCHECK));
- if ((method&M_NOCHECK) || (!(object)QueryProp(P_WORN)))
+ if ((method&M_NOCHECK) || (!QueryProp(P_WORN)))
return ::move(dest, method);
return ME_CANT_BE_DROPPED;
@@ -37,7 +37,7 @@
if (objectp(QueryProp(P_WORN)))
DoUnwear(M_SILENT|M_NOCHECK);
- if (!(object)QueryProp(P_WORN))
+ if (!QueryProp(P_WORN))
return ::remove(silent);
// Ausziehen hat irgendwie nicht geklappt. :-(
return 0;
diff --git a/std/clothing/wear.c b/std/clothing/wear.c
index 1555b4e..69cb54f 100644
--- a/std/clothing/wear.c
+++ b/std/clothing/wear.c
@@ -112,7 +112,8 @@
(all?(Name(WER)+": "):0)));
}
if ( objectp(environment()) && objectp(environment(environment())) )
- tell_room(environment(environment()),break_string(PL->Name(WER)
+ tell_room(environment(environment()),break_string(
+ ({string})PL->Name(WER)
+ " zieht " + name(WEN,0) +" an.",78), ({PL}));
}
@@ -173,7 +174,8 @@
(all?(Name(WER)+": "):0)));
}
if ( objectp(environment(worn_by)) )
- tell_room(environment(worn_by), break_string(worn_by->Name(WER)
+ tell_room(environment(worn_by), break_string(
+ ({string})worn_by->Name(WER)
+ " zieht " + name(WEN,0) + " aus.",78), ({ worn_by }) );
}
@@ -223,7 +225,7 @@
// gleich auf eine WearFunc zurueckgreifen zu muessen.
// Die Auswertung erfolgt ueber den RestrictionChecker
if ((res=QueryProp(P_RESTRICTIONS)) && mappingp(res) &&
- (res=(string)"/std/restriction_checker"->check_restrictions(PL,res))
+ (res=({string})"/std/restriction_checker"->check_restrictions(PL,res))
&& stringp(res)) {
msg(break_string(res,78,(all?(Name(WER)+": "):0)),all);
return(-1);
@@ -231,7 +233,7 @@
// Ist eine WearFunc gesetzt, wird diese aufgerufen.
if (objectp(res=QueryProp(P_WEAR_FUNC)) &&
- !(res->WearFunc(ME, silent, environment()))) {
+ !(({int})res->WearFunc(ME, silent, environment()))) {
// Eine Meldung muss von der WearFunc ausgegeben werden
return(-2);
}
@@ -276,7 +278,7 @@
// Wenn Haende benutzt werden sollen, muss natuerlich auch getestet
// werden, ob das ueberhaupt geht
if (nh>0) {
- if (!(PL->UseHands(ME, nh))) {
+ if (!(({int})PL->UseHands(ME, nh))) {
// Schade, nicht genug Haende frei -> Meldung ausgeben
write(break_string("Du hast keine Hand mehr frei.",78,
(all?(Name(WER)+": "):0)));
@@ -291,16 +293,16 @@
// oder aehnliches...
if (!QueryProp(P_WEAPON_TYPE)) {
// Aktion noch setzen, Spieler hat ja was angezogen
- PL->SetProp(P_LAST_WEAR_ACTION,({WA_WEAR,time()}));
+ ({int*})PL->SetProp(P_LAST_WEAR_ACTION,({WA_WEAR,time()}));
// Im Kampf verliert der Spieler durch Kleidungswechsel eine Runde.
- if (PL->InFight()) {
- PL->SetProp(P_ATTACK_BUSY,1);
+ if (({int})PL->InFight()) {
+ ({int})PL->SetProp(P_ATTACK_BUSY,1);
}
}
// Eintragen in P_CLOTHING/P_ARMOURS
- PL->Wear(this_object());
+ ({int})PL->Wear(this_object());
- PL->SetProp(P_EQUIP_TIME,time());
+ ({int})PL->SetProp(P_EQUIP_TIME,time());
SetProp(P_WORN, PL);
SetProp(P_EQUIP_TIME,time());
@@ -329,7 +331,7 @@
// Im Falle von M_NOCHECK wird das Ergebnis allerdings ignoriert.
mixed res=QueryProp(P_REMOVE_FUNC);
if (objectp(res)
- && !res->RemoveFunc(ME,silent,worn_by)
+ && !({int})res->RemoveFunc(ME,silent,worn_by)
&& !(silent & M_NOCHECK)
)
{
@@ -408,14 +410,14 @@
return(!all);
// OK, alles klar, die Ruestung wird ausgezogen
- worn_by->Unwear(ME);
+ ({int})worn_by->Unwear(ME);
// Benutzte Haende wieder freigeben
if (nh>0) {
- worn_by->FreeHands(ME);
+ ({int})worn_by->FreeHands(ME);
}
- worn_by->SetProp(P_EQUIP_TIME, time());
+ ({int})worn_by->SetProp(P_EQUIP_TIME, time());
SetProp(P_WORN, 0);
// Flag noch setzen, Spieler hat ja was ausgezogen
@@ -424,9 +426,9 @@
if (PL && PL==worn_by && !QueryProp(P_WEAPON_TYPE)) {
//Behinderung beim Wechsel nur fuer Spieler
if (query_once_interactive(PL)) {
- PL->SetProp(P_LAST_WEAR_ACTION,({WA_UNWEAR,time()}));
- if (PL->InFight()) {
- PL->SetProp(P_ATTACK_BUSY,1);
+ ({int*})PL->SetProp(P_LAST_WEAR_ACTION,({WA_UNWEAR,time()}));
+ if (({int})PL->InFight()) {
+ ({int})PL->SetProp(P_ATTACK_BUSY,1);
}
}
}
@@ -453,8 +455,8 @@
}
// Vielleicht darf der Spieler ja gar nix mehr anziehen.
- if ((object)PL->InFight()) {
- last=(int*)PL->QueryProp(P_LAST_WEAR_ACTION);
+ if (({int})PL->InFight()) {
+ last=({int*})PL->QueryProp(P_LAST_WEAR_ACTION);
if (pointerp(last) && (last[0]==WA_UNWEAR) && ((time()-last[1])<2)) {
notify_fail("Du hast doch gerade erst etwas ausgezogen!\n"
"So schnell bist Du nicht!\n");
@@ -503,8 +505,8 @@
}
// Vielleicht darf der Spieler ja gar nichts mehr ausziehen.
- if ((object)PL->InFight()) {
- last=(int*)PL->QueryProp(P_LAST_WEAR_ACTION);
+ if (({int})PL->InFight()) {
+ last=({int*})PL->QueryProp(P_LAST_WEAR_ACTION);
if (pointerp(last) && (last[0]==WA_WEAR) && ((time()-last[1])<2)) {
notify_fail("Du hast doch gerade erst etwas angezogen!\n"
"So schnell bist Du nicht!\n");
diff --git a/std/npc/combat.c b/std/npc/combat.c
index 99f30a0..1e17201 100644
--- a/std/npc/combat.c
+++ b/std/npc/combat.c
@@ -277,7 +277,7 @@
for (i=sizeof(ind)-1;i>=0;i--) {
x=ind[i];
if ((z=m[x][ob->QueryProp(x)]) || (z=m[x][0])) {
- f=f+(float)z;
+ f=f+z;
n++;
}
}
diff --git a/std/room/pub.c b/std/room/pub.c
index b331452..cad1289 100644
--- a/std/room/pub.c
+++ b/std/room/pub.c
@@ -888,14 +888,14 @@
return 1;
}
- notify_fail((string)QueryProp(P_PUB_NOT_ON_MENU)||"So etwas gibt es hier nicht!\n");
+ notify_fail(QueryProp(P_PUB_NOT_ON_MENU)||"So etwas gibt es hier nicht!\n");
return search_what(what,PL,target);
}
int bestelle(string str)
{
- notify_fail((string)QueryProp(P_PUB_NOT_ON_MENU));
+ notify_fail(QueryProp(P_PUB_NOT_ON_MENU));
if ( !stringp(str) )
return 0;
diff --git a/std/spellbook.c b/std/spellbook.c
index 5c835f1..4b28a48 100644
--- a/std/spellbook.c
+++ b/std/spellbook.c
@@ -106,28 +106,28 @@
mixed no_attack;
int nomag;
- if (no_attack = (mixed)victim->QueryProp(P_NO_ATTACK)) {
+ if (no_attack = ({int|string})victim->QueryProp(P_NO_ATTACK)) {
if (stringp(no_attack))
- caster->ReceiveMsg(
+ ({int})caster->ReceiveMsg(
no_attack,
MT_NOTIFICATION,
MA_FIGHT);
else
- caster->ReceiveMsg(
- victim->Name(WER,1)+" laesst sich nicht angreifen!",
+ ({int})caster->ReceiveMsg(
+ ({string})victim->Name(WER,1)+" laesst sich nicht angreifen!",
MT_NOTIFICATION,
MA_FIGHT);
return 0;
}
- if (victim->QueryProp(P_GHOST)) {
- caster->ReceiveMsg(
- victim->Name(WER,1)+" ist ein Geist!",
+ if (({int})victim->QueryProp(P_GHOST)) {
+ ({int})caster->ReceiveMsg(
+ ({string})victim->Name(WER,1)+" ist ein Geist!",
MT_NOTIFICATION,
MA_FIGHT);
return 0;
}
- damage=(damage*(int)caster->QuerySkillAttribute(SA_DAMAGE))/100;
+ damage=(damage*({int})caster->QuerySkillAttribute(SA_DAMAGE))/100;
// ggf. Loggen von PK-Versuchen und ggf. ausserdem Angriff abbrechen.
// BTW: Aufruf von InsertEnemy() gibt 0 zurueck, wenn der Gegner nicht
@@ -140,22 +140,22 @@
sprintf("Spellbook: %O, Spell: %O\n",
object_name(this_object()),
((mappingp(sinfo) && is_spell) ? sinfo[SP_NAME] : "")))
- && !caster->IsEnemy(victim)
- && !caster->InsertEnemy(victim)
+ && !({int})caster->IsEnemy(victim)
+ && !({int})caster->InsertEnemy(victim)
)
{
tell_object(ME, "Ein goettlicher Einfluss schuetzt Deinen Gegner.\n");
return 0;
}
- nomag=(int)victim->QueryProp(P_NOMAGIC);
+ nomag=({int})victim->QueryProp(P_NOMAGIC);
if ((sinfo[SI_NOMAGIC] < nomag) &&
- nomag*100 > random(100)*(int)caster->QuerySkillAttribute(SA_ENEMY_SAVE)) {
- printf("%s wehrt Deinen Zauber ab.\n", capitalize((string)victim->name(WER, 1)));
+ nomag*100 > random(100)*({int})caster->QuerySkillAttribute(SA_ENEMY_SAVE)) {
+ printf("%s wehrt Deinen Zauber ab.\n", capitalize(({string})victim->name(WER, 1)));
return 0;
}
else {
- return (int)victim->Defend(damage, dtypes, is_spell, caster);
+ return ({int})victim->Defend(damage, dtypes, is_spell, caster);
}
}
@@ -168,7 +168,7 @@
if (!si_spell) si_spell=sinfo[SI_SPELL];
// Wenn der Spieler in einem Team ist, die Teamreihen-Boni
// beruecksichtigen. Wenn nicht, eben nicht.
- if (!team=((object)caster->QueryProp(P_TEAM)))
+ if (!team=(({object})caster->QueryProp(P_TEAM)))
return TryAttackSpell(victim,
GetRandFValueO(SI_SKILLDAMAGE,sinfo,caster),
GetData(SI_SKILLDAMAGE_TYPE,sinfo,caster),
@@ -177,7 +177,7 @@
sinfo);
else
{
- row=(int)caster->PresentPosition();
+ row=({int})caster->PresentPosition();
return TryAttackSpell(victim,
GetRandFValueO(SI_SKILLDAMAGE,sinfo,caster)+
// Nur wenn SI_SKILLDAMAGE_BY_ROW ein mapping ist,
@@ -199,17 +199,17 @@
int cval,abil,res;
abil=sinfo[SI_SKILLABILITY];
- cval=(int)caster->UseSkill(SK_CASTING);
+ cval=({int})caster->UseSkill(SK_CASTING);
res=abil + (SMUL(abil,cval)) / MAX_ABILITY - random(MAX_ABILITY);
if (cval && res>MAX_ABILITY) // besonders gut gelungen?
- caster->LearnSkill(SK_CASTING,1+(res-MAX_ABILITY)/2000);
+ ({void})caster->LearnSkill(SK_CASTING,1+(res-MAX_ABILITY)/2000);
return res;
}
int
CanTrySpell(object caster, mapping sinfo) {
- if (caster->QueryProp(P_GHOST)) {
- caster->ReceiveMsg(
+ if (({int})caster->QueryProp(P_GHOST)) {
+ ({int})caster->ReceiveMsg(
"Als Geist kannst Du nicht zaubern.",
MT_NOTIFICATION,
MA_SPELL);
@@ -220,7 +220,7 @@
if (mappingp(rmap)
&& (res=check_restrictions(caster,rmap)))
{
- caster->ReceiveMsg(res, MT_NOTIFICATION|MSG_DONT_WRAP, MA_SPELL);
+ ({int})caster->ReceiveMsg(res, MT_NOTIFICATION|MSG_DONT_WRAP, MA_SPELL);
return 0;
}
return 1;
@@ -243,15 +243,15 @@
// Ich gehe davon aus, dass wir nie nie nie
// ein weiteres Attribut ins MG einfuegen.
// Wir berechnen den Mittelwert
- attval=((int)caster->QueryAttribute(A_INT)*attr[A_INT]+
- (int)caster->QueryAttribute(A_DEX)*attr[A_DEX]+
- (int)caster->QueryAttribute(A_STR)*attr[A_STR]+
- (int)caster->QueryAttribute(A_CON)*attr[A_CON])
+ attval=(({int})caster->QueryAttribute(A_INT)*attr[A_INT]+
+ ({int})caster->QueryAttribute(A_DEX)*attr[A_DEX]+
+ ({int})caster->QueryAttribute(A_STR)*attr[A_STR]+
+ ({int})caster->QueryAttribute(A_CON)*attr[A_CON])
/(attr[A_CON]+attr[A_INT]+attr[A_STR]+attr[A_DEX]);
} else {
- attval=(int)caster->QueryAttribute(A_INT);
+ attval=({int})caster->QueryAttribute(A_INT);
}
@@ -259,19 +259,19 @@
GetOffset(SI_SKILLLEARN,sinfo,caster));
if (!(diff=GetFValueO(SI_DIFFICULTY,sinfo,caster)))
diff=GetFValueO(SI_SPELLCOST,sinfo,caster);
- caster->LearnSkill(spell,val,diff);
+ ({void})caster->LearnSkill(spell,val,diff);
}
void
Erfolg(object caster, string spell, mapping sinfo) {
object env;
if(env=environment(caster))
- env->SpellInform(caster,spell,sinfo);
+ ({void})env->SpellInform(caster,spell,sinfo);
}
void
Misserfolg(object caster, string spell, mapping sinfo) {
- caster->ReceiveMsg(
+ ({int})caster->ReceiveMsg(
"Der Zauberspruch ist missglueckt.\n"
"Du lernst aus Deinem Fehler.\n",
MT_NOTIFICATION|MSG_DONT_WRAP,
@@ -319,14 +319,14 @@
if (!CanTrySpell(caster, ski))
return 1;
- if (caster->QueryProp(P_SP) < (cost=GetFValueO(SI_SPELLCOST,ski,caster))) {
+ if (({int})caster->QueryProp(P_SP) < (cost=GetFValueO(SI_SPELLCOST,ski,caster))) {
if(txt=ski[SI_SP_LOW_MSG])
- caster->ReceiveMsg(
+ ({int})caster->ReceiveMsg(
txt,
MT_NOTIFICATION,
MA_SPELL);
else
- caster->ReceiveMsg(
+ ({int})caster->ReceiveMsg(
"Du hast zu wenig Zauberpunkte fuer diesen Spruch.",
MT_NOTIFICATION,
MA_SPELL);
@@ -339,9 +339,9 @@
// nicht leer ist, ist man zu erschoepft.
tmp = filter(ski[SI_X_SPELLFATIGUE],
function int (string key, int val)
- { return (int)caster->CheckSpellFatigue(key); } );
+ { return ({int})caster->CheckSpellFatigue(key); } );
if (sizeof(tmp)) {
- caster->ReceiveMsg(
+ ({int})caster->ReceiveMsg(
ski[SI_TIME_MSG] ||
"Du bist noch zu erschoepft von Deinem letzten Spruch.",
MT_NOTIFICATION,
@@ -350,8 +350,8 @@
}
}
else {
- if (caster->CheckSpellFatigue()) {
- caster->ReceiveMsg(
+ if (({int})caster->CheckSpellFatigue()) {
+ ({int})caster->ReceiveMsg(
ski[SI_TIME_MSG] ||
"Du bist noch zu erschoepft von Deinem letzten Spruch.",
MT_NOTIFICATION,
@@ -361,14 +361,14 @@
}
if (!(ski[SI_NO_ATTACK_BUSY]&NO_ATTACK_BUSY_QUERY) &&
- caster->QueryProp(P_ATTACK_BUSY)) {
+ ({int})caster->QueryProp(P_ATTACK_BUSY)) {
if (txt=ski[SI_ATTACK_BUSY_MSG])
- caster->ReceiveMsg(
+ ({int})caster->ReceiveMsg(
txt,
MT_NOTIFICATION,
MA_SPELL);
else
- caster->ReceiveMsg(
+ ({int})caster->ReceiveMsg(
"Du bist schon zu sehr beschaeftigt.",
MT_NOTIFICATION,
MA_SPELL);
@@ -376,13 +376,13 @@
}
// Spruchvorbereitung
- if (pointerp(ps=(mixed)caster->QueryProp(P_PREPARED_SPELL)) // Ausstehender Spruch
+ if (pointerp(ps=({<int|mapping|string>*})caster->QueryProp(P_PREPARED_SPELL)) // Ausstehender Spruch
&& sizeof(ps)>=3 && intp(ps[0] && stringp(ps[1]))) {
if (ps[1]==spell) { // Dieser Spruch wird noch vorbereitet
if (time()<ps[0]) {
if (!stringp(txt=ski[SI_PREPARE_BUSY_MSG]))
txt="Du bist noch mit der Spruchvorbereitung beschaeftigt.\n";
- caster->ReceiveMsg(
+ ({int})caster->ReceiveMsg(
txt,
MT_NOTIFICATION,
MA_SPELL);
@@ -396,7 +396,7 @@
printf(txt,ps[1]);
if (fat=GetValue(SI_PREPARE_TIME,ski,caster)) {
// Spruch braucht vorbereitungszeit
- caster->SetProp(P_PREPARED_SPELL,({time()+fat,spell,ski[SI_SKILLARG]}));
+ ({<int|mapping|string>*})caster->SetProp(P_PREPARED_SPELL,({time()+fat,spell,ski[SI_SKILLARG]}));
prepare_spell(caster,spell,ski);
return 1;
}
@@ -405,27 +405,27 @@
else {
if (fat=GetValue(SI_PREPARE_TIME,ski,caster)) {
// Spruch braucht vorbereitungszeit
- caster->SetProp(P_PREPARED_SPELL,({time()+fat,spell,ski[SI_SKILLARG]}));
+ ({<int|mapping|string>*})caster->SetProp(P_PREPARED_SPELL,({time()+fat,spell,ski[SI_SKILLARG]}));
prepare_spell(caster,spell,ski);
return 1;
}
}
if (ps)
- caster->SetProp(P_PREPARED_SPELL,0);
+ ({<int|mapping|string>*})caster->SetProp(P_PREPARED_SPELL,0);
// Funktion kann anderen Namen haben als Spell
if (!(fname=sinfo[SI_SKILLFUNC]))
fname=sname;
- if((ski[SI_NOMAGIC] < environment(caster)->QueryProp(P_NOMAGIC)) &&
- random(100) < environment(caster)->QueryProp(P_NOMAGIC)) {
+ if((ski[SI_NOMAGIC] < ({int})environment(caster)->QueryProp(P_NOMAGIC)) &&
+ random(100) < ({int})environment(caster)->QueryProp(P_NOMAGIC)) {
if (txt=ski[SI_NOMAGIC_MSG])
- caster->ReceiveMsg(
+ ({int})caster->ReceiveMsg(
txt,
MT_NOTIFICATION,
MA_SPELL);
else
- caster->ReceiveMsg(
+ ({int})caster->ReceiveMsg(
"Dein Zauberspruch verpufft im Nichts.",
MT_NOTIFICATION,
MA_SPELL);
@@ -433,7 +433,7 @@
}
else {
// Spruch ausfuehren.
- res=(int)call_other(this_object(),fname,caster,ski);
+ res=funcall(symbol_function(fname),caster,ski);
}
if (!res || !caster)
return 1;
@@ -444,24 +444,24 @@
if (!(ski[SI_NO_ATTACK_BUSY]&NO_ATTACK_BUSY_QUERY))
{
if (!ski[SI_ATTACK_BUSY_AMOUNT])
- caster->SetProp(P_ATTACK_BUSY,1);
+ ({int})caster->SetProp(P_ATTACK_BUSY,1);
else
- caster->SetProp(P_ATTACK_BUSY,ski[SI_ATTACK_BUSY_AMOUNT]);
+ ({int})caster->SetProp(P_ATTACK_BUSY,ski[SI_ATTACK_BUSY_AMOUNT]);
}
- caster->restore_spell_points(-1*cost);
+ ({void})caster->restore_spell_points(-1*cost);
if (mappingp(ski[SI_X_SPELLFATIGUE])) {
// fuer jeden Key die Spellfatigue setzen. Keys mit Dauer 0 loesen keine
// Spellfatigue aus.
filter(ski[SI_X_SPELLFATIGUE],
function int (string key, int val)
- { return (int)caster->SetSpellFatigue(val, key); } );
+ { return ({int})caster->SetSpellFatigue(val, key); } );
}
else {
if ((fat=GetFValueO(SI_SPELLFATIGUE,ski,caster))<0)
fat=1;
- caster->SetSpellFatigue(fat);
+ ({int})caster->SetSpellFatigue(fat);
}
@@ -482,11 +482,11 @@
res=({});
if (!pl || !(env=environment(pl))) return res;
p1 = query_once_interactive(pl) ? 1 : -1;
- team=(object)pl->QueryProp(P_TEAM);
+ team=({object})pl->QueryProp(P_TEAM);
for (ob=first_inventory(env);ob;ob=next_inventory(ob)) {
if (!living(ob)) continue;
qp=symbol_function("QueryProp",ob);
- if (pl->IsEnemy(ob)) // Feinde sind immer Gegner
+ if (({int})pl->IsEnemy(ob)) // Feinde sind immer Gegner
p2=-1*p1;
else if (objectp(team) && funcall(qp,P_TEAM)==team)
p2=p1; // Teammitglieder sind immer auf Seite des Spielers
@@ -499,7 +499,7 @@
if ( who<0 && (funcall(qp,P_NO_ATTACK) || funcall(qp,P_NO_GLOBAL_ATTACK)) )
continue;
if (IS_LEARNING(ob) &&
- (funcall(qp,P_INVIS) || (who<0 && !pl->IsEnemy(ob))))
+ (funcall(qp,P_INVIS) || (who<0 && !({int})pl->IsEnemy(ob))))
continue;
if (p1*p2*who >=0)
res+=({ob});
@@ -510,7 +510,7 @@
object *
FindGroupN(object pl, int who, int n) {
if (!pl) return ({});
- n=(n*(int)pl->QuerySkillAttribute(SA_EXTENSION))/100;
+ n=(n*({int})pl->QuerySkillAttribute(SA_EXTENSION))/100;
if (n<1) n=1;
return FindGroup(pl,who)[0..(n-1)];
}
@@ -522,7 +522,7 @@
nres=({});
if (!pl) return nres;
- pr=(pr*(int)pl->QuerySkillAttribute(SA_EXTENSION))/100;
+ pr=(pr*({int})pl->QuerySkillAttribute(SA_EXTENSION))/100;
if (pr<0) return nres;
res=FindGroup(pl,who);
for (i=sizeof(res)-1;i>=0;i--)
@@ -544,16 +544,16 @@
return ({({}),({})});
if (!dy) dy=100;
if (!dx) dx=MAX_TEAM_ROWLEN*100;
- x=(int)pl->QuerySkillAttribute(SA_EXTENSION);
+ x=({int})pl->QuerySkillAttribute(SA_EXTENSION);
dx=(dx*x)/100;dy=(dy*x)/100;
- dist=(dist*(int)pl->QuerySkillAttribute(SA_RANGE))/100;
+ dist=(dist*({int})pl->QuerySkillAttribute(SA_RANGE))/100;
min=dist-dy/2;
max=dist+dy/2;
pos=([]);
p1=query_once_interactive(pl) ? 1 : -1;
is_enemy=symbol_function("IsEnemy",pl); // zur Beschleunigung
- myteam=(object)pl->QueryProp(P_TEAM);
+ myteam=({object})pl->QueryProp(P_TEAM);
for (ob=first_inventory(environment(pl));ob;ob=next_inventory(ob)) {
if (!living(ob)) continue;
qp=symbol_function("QueryProp",ob); // zur Beschleunigung
@@ -561,7 +561,7 @@
// Zuerst mal die Position feststellen:
if (!objectp(enteam=funcall(qp,P_TEAM)))
pos[ob]=1;
- else if (!pos[ob] && mappingp(x=(mapping)ob->PresentTeamPositions()))
+ else if (!pos[ob] && mappingp(x=({mapping})ob->PresentTeamPositions()))
pos+=x;
// PresentTeamPositions wird nur einmal pro Team ausgerechnet, weil
// anschliessend jedes anwesende Teammitglied pos[ob]!=0 hat.
@@ -575,7 +575,7 @@
else if (objectp(myteam) && myteam==enteam)
; // Teammitglieder sind immer auf eigener Seite
else
- pos[ob]*=(p1*((int)(query_once_interactive(ob)||
+ pos[ob]*=(p1*((query_once_interactive(ob)||
funcall(qp,P_FRIEND))?1:-1));
// Den Spieler auf keinen Fall entfernen
@@ -652,7 +652,7 @@
if (!pl) return 0;
if (!sizeof(wen)) {
- if (victim = (object)pl->SelectEnemy())
+ if (victim = ({object})pl->SelectEnemy())
return victim;
else
return 0;
@@ -669,7 +669,7 @@
object vic;
if (!(vic=find_victim(wen,pl)) && msg)
- pl->ReceiveMsg(
+ ({int})pl->ReceiveMsg(
msg,
MT_NOTIFICATION,
MA_SPELL);
@@ -681,8 +681,8 @@
if (!(vic=FindVictim(wen,pl,msg)))
return 0;
- if (!living(vic) || vic->QueryProp(P_GHOST)) {
- printf("%s lebt doch nicht!\n", capitalize((string)vic->name()));
+ if (!living(vic) || ({int})vic->QueryProp(P_GHOST)) {
+ printf("%s lebt doch nicht!\n", capitalize(({string})vic->name()));
return 0;
}
return vic;
@@ -699,31 +699,31 @@
if ((stringp(wen) && wen!="") || !objectp(pl))
return 0;
if (pointerp(func)) { // Soll einer DIESER Gegner genommen werden?
- if (!(vic=(object)pl->SelectEnemy(func))) // Dann daraus auswaehlen
+ if (!(vic=({object})pl->SelectEnemy(func))) // Dann daraus auswaehlen
return 0;
} else {
if (!stringp(func))
func="SelectEnemy";
- if (!(vic=(object)call_other(pl,func,0,min,max)))
+ if (!(vic=({object})call_other(pl,func,0,min,max)))
return 0;
}
func=0; // kein zweites Mal pruefen.
}
- if (no_attack = (mixed)vic->QueryProp(P_NO_ATTACK)) {
+ if (no_attack = ({int|string})vic->QueryProp(P_NO_ATTACK)) {
if (stringp(no_attack))
- pl->ReceiveMsg(
+ ({int})pl->ReceiveMsg(
no_attack,
MT_NOTIFICATION,
MA_FIGHT);
else
- pl->ReceiveMsg(
- vic->Name(WER,1)+" laesst sich nicht angreifen.",
+ ({int})pl->ReceiveMsg(
+ ({string})vic->Name(WER,1)+" laesst sich nicht angreifen.",
MT_NOTIFICATION,
MA_FIGHT);
return 0;
}
if (vic==pl) {
- pl->ReceiveMsg(
+ ({int})pl->ReceiveMsg(
"Du koenntest Dir dabei wehtun.",
MT_NOTIFICATION,
MA_FIGHT);
@@ -732,39 +732,39 @@
if (stringp(func)) {
switch(func) {
case "SelectNearEnemy":
- if (pl->PresentPosition()>1) {
- pl->ReceiveMsg(
+ if (({int})pl->PresentPosition()>1) {
+ ({int})pl->ReceiveMsg(
"Du stehst nicht in der ersten Kampfreihe.",
MT_NOTIFICATION,
MA_FIGHT);
return 0;
}
- if (vic->PresentPosition()>1) {
- pl->ReceiveMsg(
- vic->Name(WER,1)+" ist in einer hinteren Kampfreihe.",
+ if (({int})vic->PresentPosition()>1) {
+ ({int})pl->ReceiveMsg(
+ ({string})vic->Name(WER,1)+" ist in einer hinteren Kampfreihe.",
MT_NOTIFICATION,
MA_FIGHT);
return 0;
}
break;
case "SelectFarEnemy":
- if (row=(int)vic->PresentPosition())
+ if (row=({int})vic->PresentPosition())
row--;
if (row>=min && row<=max)
break;
if (row<min)
- pl->ReceiveMsg(
- vic->Name(WER,1)+" ist zu nahe.",
+ ({int})pl->ReceiveMsg(
+ ({string})vic->Name(WER,1)+" ist zu nahe.",
MT_NOTIFICATION,
MA_FIGHT);
else if (row>max)
- pl->ReceiveMsg(
- vic->Name(WER,1)+" ist zu weit weg.",
+ ({int})pl->ReceiveMsg(
+ ({string})vic->Name(WER,1)+" ist zu weit weg.",
MT_NOTIFICATION,
MA_FIGHT);
else
- pl->ReceiveMsg(
- vic->Name(WER,1)+" ist unerreichbar.",
+ ({int})pl->ReceiveMsg(
+ ({string})vic->Name(WER,1)+" ist unerreichbar.",
MT_NOTIFICATION,
MA_FIGHT);
return 0;
@@ -772,16 +772,16 @@
}
} else if (pointerp(func)) {
if (member(func,vic)<0) {
- pl->ReceiveMsg(
- vic->Name(WER,1)+" ist unerreichbar.",
+ ({int})pl->ReceiveMsg(
+ ({string})vic->Name(WER,1)+" ist unerreichbar.",
MT_NOTIFICATION,
MA_FIGHT);
return 0;
}
}
- if (!pl->IsEnemy(vic)) // War es bisher kein Feind?
- pl->Kill(vic); // Dann ist es jetzt einer.
+ if (!({int})pl->IsEnemy(vic)) // War es bisher kein Feind?
+ ({int})pl->Kill(vic); // Dann ist es jetzt einer.
return vic;
}
@@ -840,7 +840,7 @@
obs=x[0];
for (i=sizeof(obs)-1;i>=0;i--)
- if (objectp(ob=obs[i]) && suc>=ob->SpellDefend(caster,sinfo))
+ if (objectp(ob=obs[i]) && suc>=({int})ob->SpellDefend(caster,sinfo))
TryAttackSpell(ob,(damage?random(damage):
GetRandFValueO(SI_SKILLDAMAGE,sinfo,caster)),
dt,is_spell,caster,sinfo);
@@ -849,8 +849,8 @@
return 1;
obs=x[1];
for (i=sizeof(obs)-1;i>=0;i--)
- if (objectp(ob=obs[i]) && suc>=ob->SpellDefend(caster,sinfo))
- ob->reduce_hit_points(((damage?random(damage):
+ if (objectp(ob=obs[i]) && suc>=({int})ob->SpellDefend(caster,sinfo))
+ ({int})ob->reduce_hit_points(((damage?random(damage):
GetRandFValueO(SI_SKILLDAMAGE,sinfo,caster))
*coldam)/10);
// 10 statt 100 ist Absicht, weil reduce_hit_points schon um Faktor
diff --git a/std/weapon/combat.c b/std/weapon/combat.c
index 4cddc50..4130585 100644
--- a/std/weapon/combat.c
+++ b/std/weapon/combat.c
@@ -82,7 +82,7 @@
if(interactive(this_player()))
{
- this_player()->ReceiveMsg(str[0],
+ ({int})this_player()->ReceiveMsg(str[0],
MT_NOTIFICATION|MSG_BS_LEAVE_LFS, MA_WIELD, 0,
this_player());
}
@@ -99,7 +99,7 @@
s1 = replace_personal(sprintf(QueryProp(P_WIELD_MSG)[0],"@WEN2"),
({this_player(),this_object()}), 1);
- this_player()->ReceiveMsg(s1,
+ ({int})this_player()->ReceiveMsg(s1,
MT_NOTIFICATION|MSG_BS_LEAVE_LFS, MA_WIELD, 0,
this_player());
}
@@ -120,7 +120,7 @@
*/
else if(interactive(this_player()))
{
- this_player()->ReceiveMsg(
+ ({int})this_player()->ReceiveMsg(
"Du zueckst "+name(WEN,1)+".",
MT_NOTIFICATION, MA_WIELD, 0, this_player());
}
@@ -130,7 +130,7 @@
// +name(WEN,0)+".",78),({ this_player() }));
if ( objectp(environment()) && objectp(environment(environment())) )
send_room(environment(environment()),
- this_player()->Name(WER)+" zueckt "+name(WEN,0)+".",
+ ({string})this_player()->Name(WER)+" zueckt "+name(WEN,0)+".",
MT_LOOK,
MA_WIELD, 0, ({this_player()}), environment());
}
@@ -156,7 +156,7 @@
if(interactive(wielded_by))
{
- wielded_by->ReceiveMsg(str[0],
+ ({int})wielded_by->ReceiveMsg(str[0],
MT_NOTIFICATION|MSG_BS_LEAVE_LFS, MA_UNWIELD, 0, wielded_by);
}
if ( objectp(environment()) && objectp(environment(environment())) )
@@ -171,7 +171,7 @@
{
s1 = replace_personal(sprintf(QueryProp(P_UNWIELD_MSG)[0],"@WEN2"),
({this_player(),this_object()}), 1);
- wielded_by->ReceiveMsg(s1,
+ ({int})wielded_by->ReceiveMsg(s1,
MT_NOTIFICATION|MSG_BS_LEAVE_LFS, MA_UNWIELD, 0, wielded_by);
}
@@ -190,13 +190,13 @@
*/
else if(interactive(wielded_by))
{
- wielded_by->ReceiveMsg(
+ ({int})wielded_by->ReceiveMsg(
"Du steckst "+name(WEN,1)+" zurueck.",
MT_NOTIFICATION, MA_UNWIELD, 0, wielded_by);
}
if ( objectp(environment()) && objectp(environment(environment())) )
send_room(environment(environment()),
- wielded_by->Name(WER) +" steckt "+name(WEN,0)+" zurueck.",
+ ({string})wielded_by->Name(WER) +" steckt "+name(WEN,0)+" zurueck.",
MT_LOOK,
MA_UNWIELD, 0, ({wielded_by}), environment());
}
@@ -246,7 +246,7 @@
// Waffen, die ein oder mehrere Attribut veraendern und gegen
// das gesetzte Limit verstossen, haben keine Wirkung bezueglich der
// Attribute.
- if ( mappingp(res=QueryProp(P_M_ATTR_MOD)) && PL->TestLimitViolation(res) )
+ if ( mappingp(res=QueryProp(P_M_ATTR_MOD)) && ({int})PL->TestLimitViolation(res) )
{
write(break_string(
"Irgendetwas an Deiner Ausruestung verhindert, dass Du Dich mit "+
@@ -257,15 +257,15 @@
// gleich auf eine WieldFunc zurueckgreifen zu muessen.
// Die Auswertung erfolgt ueber den RestrictionChecker
if ( (res=QueryProp(P_RESTRICTIONS)) && mappingp(res) &&
- (res=(string)call_other("/std/restriction_checker","check_restrictions",
+ (res=call_other("/std/restriction_checker","check_restrictions",
PL,res)) && stringp(res) )
{
notify_fail(res);
return 0;
}
- parry=(int)QueryProp(P_PARRY);
- dex=(int)PL->QueryAttribute(A_DEX);
+ parry=QueryProp(P_PARRY);
+ dex=({int})PL->QueryAttribute(A_DEX);
// Testen, ob der Spieler die noetige Geschicklichkeit besitzt, um
// mit dieser (Parier)Waffe umgehen zu koennen
@@ -278,9 +278,9 @@
}
// Eine Gezueckte Waffe muss natuerlich erst mal weggesteckt werden.
- if ( (parry<PARRY_ONLY) && objectp(res=(object)PL->QueryProp(P_WEAPON)) )
+ if ( (parry<PARRY_ONLY) && objectp(res=({object})PL->QueryProp(P_WEAPON)) )
{
- if ( (res->DoUnwield(silent)) && !((object)PL->QueryProp(P_WEAPON)) )
+ if ( (({int})res->DoUnwield(silent)) && !(({object})PL->QueryProp(P_WEAPON)) )
{
// Wenn die alte Waffe weggesteckt werden konnte, nochmal
// versuchen zu zuecken
@@ -295,9 +295,9 @@
}
}
// Das gleiche gilt natuerlich fuer Parierwaffen
- if ( (parry>PARRY_NOT) && objectp(res=(object)PL->QueryProp(P_PARRY_WEAPON)) )
+ if ( (parry>PARRY_NOT) && objectp(res=({object})PL->QueryProp(P_PARRY_WEAPON)) )
{
- if ( (res->DoUnwield(silent)) && !(PL->QueryProp(P_PARRY_WEAPON)) )
+ if ( (({int})res->DoUnwield(silent)) && !(({object})PL->QueryProp(P_PARRY_WEAPON)) )
{
// Wenn die alte Parierwaffe weggesteckt werden konnte, nochmal
// versuchen zu zuecken
@@ -314,7 +314,7 @@
// Ist eine WieldFunc gesetzt, wird diese aufgerufen.
if (objectp(res=QueryProp(P_WIELD_FUNC))
- && !(res->WieldFunc(ME,silent,environment())))
+ && !(({int})res->WieldFunc(ME,silent,environment())))
{
// Eine Meldung sollte schon von der WieldFunc ausgegeben werden.
return 1;
@@ -336,7 +336,7 @@
}
// Testen, ob der Zuecker genug Haende frei hat.
- if (!(PL->UseHands(ME,QueryProp(P_NR_HANDS))))
+ if (!(({int})PL->UseHands(ME,QueryProp(P_NR_HANDS))))
{
notify_fail("Du hast keine Hand mehr frei.\n");
return 0;
@@ -361,18 +361,18 @@
// Waffen koennen Attribute aendern/blockieren. Also muessen diese
// nach dem Zuecken aktualisiert werden
- PL->register_modifier(ME);
- PL->UpdateAttributes();
+ ({void})PL->register_modifier(ME);
+ ({void})PL->UpdateAttributes();
// P_TOTAL_AC/P_TOTAL_WC im Spieler aktualisieren. Da dort Attribute
// eingehen, kann das erst hier gemacht werden.
if (parry<PARRY_ONLY)
{
- PL->QueryProp(P_TOTAL_WC);
+ ({int})PL->QueryProp(P_TOTAL_WC);
}
if (parry>PARRY_NOT)
{
- PL->QueryProp(P_TOTAL_AC);
+ ({int})PL->QueryProp(P_TOTAL_AC);
}
// Zueck-Meldung ausgeben, wenn das silent-Flag nicht gesetzt ist
@@ -412,7 +412,7 @@
// Ist eine UnwieldFunc gesetzt, wird diese aufgerufen
if ( objectp(res=QueryProp(P_UNWIELD_FUNC)) &&
- !(res->UnwieldFunc(ME,silent,wielded_by)) )
+ !(({int})res->UnwieldFunc(ME,silent,wielded_by)) )
{
// Eine Meldung muss die UnwieldFunc schon selbst ausgeben.
return 1;
@@ -463,23 +463,23 @@
}
// Die Haende, die bisher von der Waffe benutzt wurden, freigeben
- wielded_by->FreeHands(ME);
+ ({int})wielded_by->FreeHands(ME);
SetProp(P_WIELDED, 0);
// Waffen koennen Attribute aendern/blockieren. Also muessen diese
// nach dem Wegstecken aktualisiert werden
- wielded_by->deregister_modifier(ME);
- wielded_by->UpdateAttributes();
+ ({void})wielded_by->deregister_modifier(ME);
+ ({void})wielded_by->UpdateAttributes();
// P_TOTAL_AC/P_TOTAL_WC im Spieler aktualisieren. Da dort Attribute
// eingehen, kann das erst hier gemacht werden.
if (parry<PARRY_ONLY)
{
- wielded_by->QueryProp(P_TOTAL_WC);
+ ({int})wielded_by->QueryProp(P_TOTAL_WC);
}
if (parry>PARRY_NOT)
{
- wielded_by->QueryProp(P_TOTAL_AC);
+ ({int})wielded_by->QueryProp(P_TOTAL_AC);
}
// Inform-Funktion aufrufen
@@ -526,8 +526,8 @@
// Ist wirklich diese Waffe gemeint?
if ( !stringp(str) || !id(str) ||
- ((parry<PARRY_ONLY)&&((object)PL->QueryProp(P_WEAPON)!=ME)) ||
- ((parry>PARRY_NOT)&&((object)PL->QueryProp(P_PARRY_WEAPON)!=ME)) )
+ ((parry<PARRY_ONLY)&&(({object})PL->QueryProp(P_WEAPON)!=ME)) ||
+ ((parry>PARRY_NOT)&&(({object})PL->QueryProp(P_PARRY_WEAPON)!=ME)) )
{
return 0;
}
@@ -561,7 +561,7 @@
// Den Basis-Schaden berechnen. Die Staerke des Benutzers wird
// hier beruecksichtigt.
- dam = (2*QueryProp(P_WC)+10*((int)wielder->QueryAttribute(A_STR)))/3;
+ dam = (2*QueryProp(P_WC)+10*(({int})wielder->QueryAttribute(A_STR)))/3;
// Wie gut man getroffen hat, wird ueber ein random() simuliert
dam = random(1+dam);
@@ -746,7 +746,7 @@
// P_TOTAL_WC im Traeger updaten, so vorhanden
if (objectp(w=QueryProp(P_WIELDED)))
- w->QueryProp(P_TOTAL_WC);
+ ({int})w->QueryProp(P_TOTAL_WC);
// Rueckgabewert: Durchgefuehrte Aenderung an P_DAMAGE
return new_dam;
@@ -786,7 +786,7 @@
// P_TOTAL_AC im Traeger updaten, so vorhanden
if (objectp(w=QueryProp(P_WIELDED)))
- w->QueryProp(P_TOTAL_AC);
+ ({int})w->QueryProp(P_TOTAL_AC);
// Rueckgabewert: Durchgefuehrte Aenderung an P_DAMAGE
return new_dam;