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5GKTWMS5W3OBVHTL66RTYZIPFM6KFBYA3QC
Z6Q7JVMFQ32SC7FRGOB7CE7JS2HEOPAO3B2VLU3YR3UCUDZFIPFQC
VVEULZ7FMS53F6WZUJLNJ23URJMCCWHBUEDVGKI6R72JO2DLL5HQC
KFULGQQOHWUTXOM3BXCCYPGGVGGY4Z6265XUFRCBPNLTZAEHJZSQC
QEEJFAETO6B2J4IWDIDCJ5UNIFNNHHG22IWF2CUJRTJJBNE47CWQC
5B5DP5S6A6LQMKZYVLQAEMHQZWFWYDHPCKQGRNSCNNYIBQYZ6BIQC
RM4LRL6W56XHFWFZIA6LQLR6TPAHVSSXBVCNYZJIZSBPKFWDAJJQC
SW3RLYFNRT3IJBK6LYKHKP2J2YDU7SXQWAJZX7U6S7ICYW43OMNQC
DOZORMA366M4HB5JKSS27BMCR6ET7QNZNND2B7KV3NVEEPR5H7EAC
XYBPIU6AQ77EID4VNOMI7KQZULZI4VBZHHIGBRYO7QRJVCODEKYAC
ZLQAAP55CJ77XIJN3DZVPT4GTTVLIBFJLIJJKI6L5UBSHX7VUK6AC
if (((feature != DNGN_FLOOR
&& feature != DNGN_SHALLOW_WATER
&& feature != DNGN_DEEP_WATER
&& feature != DNGN_LAVA)
|| is_waypoint(dc.x, dc.y)
|| is_stash(ls, dc.x, dc.y))
&& dc != start)
if (dc != start
&& (feature != DNGN_FLOOR
&& feature != DNGN_SHALLOW_WATER
&& feature != DNGN_DEEP_WATER
&& feature != DNGN_LAVA
|| is_waypoint(dc.x, dc.y)
|| is_stash(ls, dc.x, dc.y)))
marshallByte(th,you.religion);
marshallByte(th,you.piety);
marshallByte(th,you.rotting);
marshallByte(th,you.symbol);
marshallByte(th,you.colour);
marshallShort(th,you.pet_target);
marshallByte(th, you.religion);
marshallByte(th, you.piety);
marshallByte(th, you.rotting);
marshallByte(th, you.symbol);
marshallByte(th, you.colour);
marshallShort(th, you.pet_target);
marshallByte(th,you.max_level);
marshallByte(th,you.where_are_you);
marshallByte(th,you.char_direction);
marshallByte(th,you.your_level);
marshallByte(th,you.is_undead);
marshallByte(th,you.special_wield);
marshallByte(th,you.berserk_penalty);
marshallByte(th,you.level_type);
marshallByte(th, you.max_level);
marshallByte(th, you.where_are_you);
marshallByte(th, you.char_direction);
marshallByte(th, you.your_level);
marshallByte(th, you.is_undead);
marshallByte(th, you.special_wield);
marshallByte(th, you.berserk_penalty);
marshallByte(th, you.level_type);
marshallByte(th,you.entry_cause);
marshallByte(th,you.entry_cause_god);
marshallByte(th,you.synch_time);
marshallByte(th,you.disease);
marshallByte(th,you.species);
marshallByte(th, you.entry_cause);
marshallByte(th, you.entry_cause_god);
marshallByte(th, you.synch_time);
marshallByte(th, you.disease);
marshallByte(th, you.species);
marshallByte(th,you.magic_points);
marshallByte(th,you.max_magic_points);
marshallByte(th,you.strength);
marshallByte(th,you.intel);
marshallByte(th,you.dex);
marshallByte(th,you.hit_points_regeneration);
marshallByte(th,you.magic_points_regeneration);
marshallByte(th, you.magic_points);
marshallByte(th, you.max_magic_points);
marshallByte(th, you.strength);
marshallByte(th, you.intel);
marshallByte(th, you.dex);
marshallByte(th, you.hit_points_regeneration);
marshallByte(th, you.magic_points_regeneration);
marshallByte(th,you.skills[j]); /* skills! */
marshallByte(th,you.practise_skill[j]); /* skills! */
marshallLong(th,you.skill_points[j]);
marshallByte(th,you.skill_order[j]); /* skills ordering */
marshallByte(th, you.skills[j]); /* skills! */
marshallByte(th, you.practise_skill[j]); /* skills! */
marshallLong(th, you.skill_points[j]);
marshallByte(th, you.skill_order[j]); /* skills ordering */
you.religion = static_cast<god_type>(unmarshallByte(th));
you.piety = unmarshallByte(th);
you.rotting = unmarshallByte(th);
you.symbol = unmarshallByte(th);
you.colour = unmarshallByte(th);
you.pet_target = unmarshallShort(th);
you.religion = static_cast<god_type>(unmarshallByte(th));
you.piety = unmarshallByte(th);
you.rotting = unmarshallByte(th);
you.symbol = unmarshallByte(th);
you.colour = unmarshallByte(th);
you.pet_target = unmarshallShort(th);
you.max_level = unmarshallByte(th);
you.where_are_you = static_cast<branch_type>( unmarshallByte(th) );
you.char_direction = static_cast<game_direction_type>(unmarshallByte(th));
you.your_level = unmarshallByte(th);
you.is_undead = static_cast<undead_state_type>(unmarshallByte(th));
you.special_wield = unmarshallByte(th);
you.max_level = unmarshallByte(th);
you.where_are_you = static_cast<branch_type>( unmarshallByte(th) );
you.char_direction = static_cast<game_direction_type>(unmarshallByte(th));
you.your_level = unmarshallByte(th);
you.is_undead = static_cast<undead_state_type>(unmarshallByte(th));
you.special_wield = unmarshallByte(th);
you.synch_time = unmarshallByte(th);
you.disease = unmarshallByte(th);
you.species = static_cast<species_type>(unmarshallByte(th));
you.hp = unmarshallShort(th);
you.hunger = unmarshallShort(th);
you.synch_time = unmarshallByte(th);
you.disease = unmarshallByte(th);
you.species = static_cast<species_type>(unmarshallByte(th));
you.hp = unmarshallShort(th);
you.hunger = unmarshallShort(th);
you.magic_points = unmarshallByte(th);
you.max_magic_points = unmarshallByte(th);
you.strength = unmarshallByte(th);
you.intel = unmarshallByte(th);
you.dex = unmarshallByte(th);
you.hit_points_regeneration = unmarshallByte(th);
you.magic_points = unmarshallByte(th);
you.max_magic_points = unmarshallByte(th);
you.strength = unmarshallByte(th);
you.intel = unmarshallByte(th);
you.dex = unmarshallByte(th);
you.hit_points_regeneration = unmarshallByte(th);
you.hit_points_regeneration = unmarshallShort(th) / 100;
you.experience = unmarshallLong(th);
you.gold = unmarshallLong(th);
you.hit_points_regeneration = unmarshallShort(th) / 100;
you.experience = unmarshallLong(th);
you.gold = unmarshallLong(th);
you.char_class = static_cast<job_type>(unmarshallByte(th));
you.experience_level = unmarshallByte(th);
you.exp_available = unmarshallLong(th);
you.char_class = static_cast<job_type>(unmarshallByte(th));
you.experience_level = unmarshallByte(th);
you.exp_available = unmarshallLong(th);
you.base_hp = unmarshallShort(th);
you.base_hp2 = unmarshallShort(th);
you.base_magic_points = unmarshallShort(th);
you.base_magic_points2 = unmarshallShort(th);
you.base_hp = unmarshallShort(th);
you.base_hp2 = unmarshallShort(th);
you.base_magic_points = unmarshallShort(th);
you.base_magic_points2 = unmarshallShort(th);
item.base_type = static_cast<object_class_type>(unmarshallByte(th));
item.sub_type = (unsigned char) unmarshallByte(th);
item.plus = unmarshallShort(th);
item.plus2 = unmarshallShort(th);
item.special = unmarshallLong(th);
item.quantity = unmarshallShort(th);
item.colour = (unsigned char) unmarshallByte(th);
item.x = unmarshallShort(th);
item.y = unmarshallShort(th);
item.flags = (unsigned long) unmarshallLong(th);
item.base_type = static_cast<object_class_type>(unmarshallByte(th));
item.sub_type = (unsigned char) unmarshallByte(th);
item.plus = unmarshallShort(th);
item.plus2 = unmarshallShort(th);
item.special = unmarshallLong(th);
item.quantity = unmarshallShort(th);
item.colour = (unsigned char) unmarshallByte(th);
item.x = unmarshallShort(th);
item.y = unmarshallShort(th);
item.flags = (unsigned long) unmarshallLong(th);
me.ench = static_cast<enchant_type>( unmarshallShort(th) );
me.degree = unmarshallShort(th);
me.who = static_cast<kill_category>( unmarshallShort(th) );
me.duration = unmarshallShort(th);
me.ench = static_cast<enchant_type>( unmarshallShort(th) );
me.degree = unmarshallShort(th);
me.who = static_cast<kill_category>( unmarshallShort(th) );
me.duration = unmarshallShort(th);
env.map[i][j].object = unmarshallShort(th);
env.map[i][j].colour = unmarshallShort(th);
env.map[i][j].flags = unmarshallShort(th);
env.map[i][j].object = unmarshallShort(th);
env.map[i][j].colour = unmarshallShort(th);
env.map[i][j].flags = unmarshallShort(th);
m.ac = unmarshallByte(th);
m.ev = unmarshallByte(th);
m.hit_dice = unmarshallByte(th);
m.speed = unmarshallByte(th);
m.ac = unmarshallByte(th);
m.ev = unmarshallByte(th);
m.hit_dice = unmarshallByte(th);
m.speed = unmarshallByte(th);
m.behaviour = static_cast<beh_type>(unmarshallByte(th));
m.x = unmarshallByte(th);
m.y = unmarshallByte(th);
m.target_x = unmarshallByte(th);
m.target_y = unmarshallByte(th);
m.flags = unmarshallLong(th);
m.experience = static_cast<unsigned long>(unmarshallLong(th));
m.behaviour = static_cast<beh_type>(unmarshallByte(th));
m.x = unmarshallByte(th);
m.y = unmarshallByte(th);
m.target_x = unmarshallByte(th);
m.target_y = unmarshallByte(th);
m.flags = unmarshallLong(th);
m.experience = static_cast<unsigned long>(unmarshallLong(th));
res.elec = unmarshallByte(th);
res.poison = unmarshallByte(th);
res.fire = unmarshallByte(th);
res.steam = unmarshallByte(th);
res.cold = unmarshallByte(th);
res.hellfire = unmarshallByte(th);
res.asphyx = unmarshallByte(th);
res.acid = unmarshallByte(th);
res.elec = unmarshallByte(th);
res.poison = unmarshallByte(th);
res.fire = unmarshallByte(th);
res.steam = unmarshallByte(th);
res.cold = unmarshallByte(th);
res.hellfire = unmarshallByte(th);
res.asphyx = unmarshallByte(th);
res.acid = unmarshallByte(th);
ghost.species = static_cast<species_type>( unmarshallShort(th) );
ghost.job = static_cast<job_type>( unmarshallShort(th) );
ghost.best_skill = static_cast<skill_type>( unmarshallShort(th) );
ghost.species = static_cast<species_type>( unmarshallShort(th) );
ghost.job = static_cast<job_type>( unmarshallShort(th) );
ghost.best_skill = static_cast<skill_type>( unmarshallShort(th) );
ghost.xl = unmarshallShort(th);
ghost.max_hp = unmarshallShort(th);
ghost.ev = unmarshallShort(th);
ghost.ac = unmarshallShort(th);
ghost.damage = unmarshallShort(th);
ghost.speed = unmarshallShort(th);
ghost.see_invis = unmarshallByte(th);
ghost.brand = static_cast<brand_type>( unmarshallShort(th) );
ghost.xl = unmarshallShort(th);
ghost.max_hp = unmarshallShort(th);
ghost.ev = unmarshallShort(th);
ghost.ac = unmarshallShort(th);
ghost.damage = unmarshallShort(th);
ghost.speed = unmarshallShort(th);
ghost.see_invis = unmarshallByte(th);
ghost.brand = static_cast<brand_type>( unmarshallShort(th) );
ghost.spellcaster = unmarshallByte(th);
ghost.cycle_colours = unmarshallByte(th);
ghost.fly = static_cast<flight_type>( unmarshallShort(th) );
ghost.spellcaster = unmarshallByte(th);
ghost.cycle_colours = unmarshallByte(th);
ghost.fly = static_cast<flight_type>( unmarshallShort(th) );
disease = 0;
elapsed_time = 0;
rotting = 0;
special_wield = SPWLD_NONE;
synch_time = 0;
disease = 0;
elapsed_time = 0;
rotting = 0;
special_wield = SPWLD_NONE;
synch_time = 0;
if (mon->foe != MHITNOT && mon->foe != MHITYOU)
if (mon->foe != MHITNOT && mon->foe != MHITYOU
&& wontAttack && mons_wont_attack(&menv[mon->foe]))
// unfriendly monsters fighting other monsters will usually
// target the player, if they're healthy
// Unfriendly monsters fighting other monsters will usually
// target the player, if they're healthy.
if (monster->behaviour == BEH_FLEE &&
(!mons_friendly(monster) ||
monster->target_x != you.x_pos || monster->target_y != you.y_pos))
if (monster->behaviour == BEH_FLEE
&& (!mons_friendly(monster)
|| monster->target_x != you.x_pos
|| monster->target_y != you.y_pos))
mprf("%s wields %s.", name(DESC_CAP_THE).c_str(),
item.name(DESC_NOCAP_A, false, false, true,
false, ISFLAG_CURSED).c_str());
snprintf(info, INFO_SIZE, " wields %s.",
item.name(DESC_NOCAP_A, false, false, true, false,
ISFLAG_CURSED).c_str());
msg = simple_monster_message(this, info);
mprf("%s unwields %s.", name(DESC_CAP_THE).c_str(),
item.name(DESC_NOCAP_A, false, false, true,
false, ISFLAG_CURSED).c_str());
snprintf(info, INFO_SIZE, " unwields %s.",
item.name(DESC_NOCAP_A, false, false, true, false,
ISFLAG_CURSED).c_str());
msg = simple_monster_message(this, info);
if (load_mode == LOAD_START_GAME ||
(load_mode == LOAD_ENTER_LEVEL &&
(old_branch != you.where_are_you ||
old_level_type != you.level_type)))
if (load_mode == LOAD_START_GAME
|| (load_mode == LOAD_ENTER_LEVEL
&& (old_branch != you.where_are_you
|| old_level_type != you.level_type)))
{