Vorher:Nachher:Das ist jetzt einfach die auf Maschinencode-Ebene vorgenomme Änderung nach C übersetzt. Ich hoffe, Du siehst, was gemeint ist; ich bin bei diesem dämlichen host_readbs-Zeug nie durchgestiegen, für mich liest sich das wie "host read bullshit". Die Konstantenbeschriftungen in BrightEyes sind übrigens falsch, es geht bei "enemy" nicht um ENEMY_SHEET_*, sondern um FIGHTER_*.
Frag mich nicht nach inhaltlichen Details, die habe ich nach vier Jahren vergessen.
Code:
void spell_skelettarius(void)
{
Bit8u *enemy;
signed short x;
signed short y;
signed char unk;
/* Set pointer to enemy target */
ds_writed(SPELLTARGET_E,
(Bit32u)RealMake(datseg, host_readbs(get_spelluser() + HERO_ENEMY_ID) * SIZEOF_ENEMY_SHEET + (ENEMY_SHEETS - 10*SIZEOF_ENEMY_SHEET)));
/* check if the enemy is dead */
if (!enemy_dead(get_spelltarget_e())) {
/* prepare message */
sprintf((char*)Real2Host(ds_readd(DTP2)),
(char*)get_tx(15),
Real2Host(GUI_names_grammar((signed short)0x8000,
host_readbs(get_spelltarget_e() + ENEMY_SHEET_MON_ID), 1)));
/* set ae costs */
ds_writew(SPELL_SPECIAL_AECOST, 0);
} else {
/* prepare message */
sprintf((char*)Real2Host(ds_readd(DTP2)),
(char*)get_tx(16),
Real2Host(GUI_names_grammar((signed short)0x8000,
host_readbs(get_spelltarget_e() + ENEMY_SHEET_MON_ID), 1)));
enemy = Real2Host(FIG_get_ptr(host_readbs(get_spelltarget_e() + ENEMY_SHEET_FIGHTER_ID)));
x = host_readbs(enemy + FIGHTER_CBX);
y = host_readbs(enemy + FIGHTER_CBY);
if (host_readbs(enemy + FIGHTER_TWOFIELDED) != -1) {
FIG_remove_from_list(ds_readbs(FIG_TWOFIELDED_TABLE + host_readbs(enemy + FIGHTER_TWOFIELDED)), 0);
}
FIG_remove_from_list(host_readbs(get_spelltarget_e() + ENEMY_SHEET_FIGHTER_ID), 0);
unk = host_readbs(get_spelltarget_e() + ENEMY_SHEET_DUMMY2);
fill_enemy_sheet(host_readbs(get_spelluser() + HERO_ENEMY_ID) - 10, 0x10, 0);
FIG_load_enemy_sprites(get_spelltarget_e() + ENEMY_SHEET_MON_ID, x, y);
or_ptr_bs(get_spelltarget_e() + ENEMY_SHEET_STATUS2, 2);
host_writebs(get_spelltarget_e() + ENEMY_SHEET_DUMMY2, unk);
}
}
Code:
void spell_skelettarius(void)
{
Bit8u *enemy;
signed short x;
signed short y;
signed char unk;
/* Set pointer to enemy target */
ds_writed(SPELLTARGET_E,
(Bit32u)RealMake(datseg, host_readbs(get_spelluser() + HERO_ENEMY_ID) * SIZEOF_ENEMY_SHEET + (ENEMY_SHEETS - 10*SIZEOF_ENEMY_SHEET)));
/* check if the enemy is dead */
if (!enemy_dead(get_spelltarget_e())) {
/* prepare message */
sprintf((char*)Real2Host(ds_readd(DTP2)),
(char*)get_tx(15),
Real2Host(GUI_names_grammar((signed short)0x8000,
host_readbs(get_spelltarget_e() + ENEMY_SHEET_MON_ID), 1)));
/* set ae costs */
ds_writew(SPELL_SPECIAL_AECOST, 0);
} else {
/* prepare message */
sprintf((char*)Real2Host(ds_readd(DTP2)),
(char*)get_tx(16),
Real2Host(GUI_names_grammar((signed short)0x8000,
host_readbs(get_spelltarget_e() + ENEMY_SHEET_MON_ID), 1)));
enemy = Real2Host(FIG_get_ptr(host_readbs(get_spelltarget_e() + ENEMY_SHEET_FIGHTER_ID)));
x = host_readbs(enemy + FIGHTER_CBX);
y = host_readbs(enemy + FIGHTER_CBY);
RealPt temp1 =datseg[FIGHTOBJ_BUF_SEEK_PTR];
RealPt temp2 =datseg[FIGHTOBJ_BUF_FREESPACE];
datseg[FIGHTOBJ_BUF_SEEK_PTR] =*(enemy +FIGHTER_GFXBUF);
if (host_readbs(enemy + FIGHTER_TWOFIELDED) != -1) {
FIG_remove_from_list(ds_readbs(FIG_TWOFIELDED_TABLE + host_readbs(enemy + FIGHTER_TWOFIELDED)), 0);
}
FIG_remove_from_list(host_readbs(get_spelltarget_e() + ENEMY_SHEET_FIGHTER_ID), 0);
unk = host_readbs(get_spelltarget_e() + ENEMY_SHEET_DUMMY2);
fill_enemy_sheet(host_readbs(get_spelluser() + HERO_ENEMY_ID) - 10, 0x10, 0);
FIG_load_enemy_sprites(get_spelltarget_e() + ENEMY_SHEET_MON_ID, x, y);
or_ptr_bs(get_spelltarget_e() + ENEMY_SHEET_STATUS2, 2);
datseg[FIGHTOBJ_BUF_SEEK_PTR] =temp1;
datseg[FIGHTOBJ_BUF_FREESPACE] =temp2;
host_writebs(get_spelltarget_e() + ENEMY_SHEET_DUMMY2, unk);
}
}
Frag mich nicht nach inhaltlichen Details, die habe ich nach vier Jahren vergessen.