Separate summoned monster duration from whether it was summoned by the party

This commit is contained in:
2015-01-28 17:43:22 -05:00
parent ef288f118f
commit 76295e2f25
11 changed files with 60 additions and 61 deletions

View File

@@ -531,9 +531,9 @@ static void handle_talk(location destination, bool& did_something, bool& need_re
need_redraw = true; need_redraw = true;
if(univ.town.monst[i].attitude % 2 == 1) { if(univ.town.monst[i].attitude % 2 == 1) {
add_string_to_buf(" Creature is hostile."); add_string_to_buf(" Creature is hostile.");
} else if(univ.town.monst[i].summoned > 0 || univ.town.monst[i].personality < 0) { } else if(univ.town.monst[i].summon_time > 0 || univ.town.monst[i].personality < 0) {
short small_talk = 1; short small_talk = 1;
if(!univ.town.monst[i].summoned) if(univ.town.monst[i].summon_time == 0)
small_talk = -univ.town.monst[i].personality; small_talk = -univ.town.monst[i].personality;
std::string str = "No response."; std::string str = "No response.";
if(small_talk > 1000) str = univ.scenario.spec_strs[small_talk - 1000]; if(small_talk > 1000) str = univ.scenario.spec_strs[small_talk - 1000];

View File

@@ -1199,59 +1199,59 @@ void do_combat_cast(location target) {
switch(spell_being_cast) { switch(spell_being_cast) {
case eSpell::SIMULACRUM: case eSpell::SIMULACRUM:
r2 = get_ran(3,1,4) + caster.stat_adj(eSkill::INTELLIGENCE); r2 = get_ran(3,1,4) + caster.stat_adj(eSkill::INTELLIGENCE);
if(!summon_monster(store_sum_monst,target,r2,2)) if(!summon_monster(store_sum_monst,target,r2,2,true))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
break; break;
case eSpell::SUMMON_BEAST: case eSpell::SUMMON_BEAST:
r2 = get_ran(3,1,4) + caster.stat_adj(eSkill::INTELLIGENCE); r2 = get_ran(3,1,4) + caster.stat_adj(eSkill::INTELLIGENCE);
if((summon == 0) || (!summon_monster(summon,target,r2,2))) if((summon == 0) || (!summon_monster(summon,target,r2,2,true)))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
break; break;
case eSpell::SUMMON_WEAK: case eSpell::SUMMON_WEAK:
r2 = get_ran(4,1,4) + caster.stat_adj(eSkill::INTELLIGENCE); r2 = get_ran(4,1,4) + caster.stat_adj(eSkill::INTELLIGENCE);
if((summon == 0) || (!summon_monster(summon,target,r2,2))) if((summon == 0) || (!summon_monster(summon,target,r2,2,true)))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
break; break;
case eSpell::SUMMON: case eSpell::SUMMON:
r2 = get_ran(5,1,4) + caster.stat_adj(eSkill::INTELLIGENCE); r2 = get_ran(5,1,4) + caster.stat_adj(eSkill::INTELLIGENCE);
if((summon == 0) || (!summon_monster(summon,target,r2,2))) if((summon == 0) || (!summon_monster(summon,target,r2,2,true)))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
break; break;
case eSpell::SUMMON_MAJOR: case eSpell::SUMMON_MAJOR:
r2 = get_ran(7,1,4) + caster.stat_adj(eSkill::INTELLIGENCE); r2 = get_ran(7,1,4) + caster.stat_adj(eSkill::INTELLIGENCE);
if((summon == 0) || (!summon_monster(summon,target,r2,2))) if((summon == 0) || (!summon_monster(summon,target,r2,2,true)))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
break; break;
case eSpell::DEMON: case eSpell::DEMON:
r2 = get_ran(5,1,4) + caster.stat_adj(eSkill::INTELLIGENCE); r2 = get_ran(5,1,4) + caster.stat_adj(eSkill::INTELLIGENCE);
if(!summon_monster(85,target,r2,2)) if(!summon_monster(85,target,r2,2,true))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
break; break;
case eSpell::SUMMON_RAT: case eSpell::SUMMON_RAT:
r1 = get_ran(3,1,4) + caster.stat_adj(eSkill::INTELLIGENCE); r1 = get_ran(3,1,4) + caster.stat_adj(eSkill::INTELLIGENCE);
if(!summon_monster(80,target,r1,2)) if(!summon_monster(80,target,r1,2,true))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
break; break;
case eSpell::SUMMON_SPIRIT: case eSpell::SUMMON_SPIRIT:
r2 = get_ran(2,1,5) + caster.stat_adj(eSkill::INTELLIGENCE); r2 = get_ran(2,1,5) + caster.stat_adj(eSkill::INTELLIGENCE);
if(!summon_monster(125,target,r2,2)) if(!summon_monster(125,target,r2,2,true))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
break; break;
case eSpell::STICKS_TO_SNAKES: case eSpell::STICKS_TO_SNAKES:
r1 = get_ran(1,0,7); r1 = get_ran(1,0,7);
r2 = get_ran(2,1,5) + caster.stat_adj(eSkill::INTELLIGENCE); r2 = get_ran(2,1,5) + caster.stat_adj(eSkill::INTELLIGENCE);
if(!summon_monster((r1 == 1) ? 100 : 99,target,r2,2)) if(!summon_monster((r1 == 1) ? 100 : 99,target,r2,2,true))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
break; break;
case eSpell::SUMMON_HOST: // host case eSpell::SUMMON_HOST: // host
r2 = get_ran(2,1,4) + caster.stat_adj(eSkill::INTELLIGENCE); r2 = get_ran(2,1,4) + caster.stat_adj(eSkill::INTELLIGENCE);
if(!summon_monster((i == 0) ? 126 : 125,target,r2,2)) if(!summon_monster((i == 0) ? 126 : 125,target,r2,2,true))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
break; break;
case eSpell::SUMMON_GUARDIAN: // guardian case eSpell::SUMMON_GUARDIAN: // guardian
r2 = get_ran(6,1,4) + caster.stat_adj(eSkill::INTELLIGENCE); r2 = get_ran(6,1,4) + caster.stat_adj(eSkill::INTELLIGENCE);
if(!summon_monster(122,target,r2,2)) if(!summon_monster(122,target,r2,2,true))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
break; break;
default: default:
@@ -2124,12 +2124,12 @@ void do_monster_turn() {
// Now take care of summoned monsters // Now take care of summoned monsters
if(cur_monst->active > 0) { if(cur_monst->active > 0) {
if((cur_monst->summoned % 100) == 1) { if(cur_monst->summon_time == 1) {
cur_monst->active = 0; cur_monst->active = 0;
cur_monst->ap = 0; cur_monst->ap = 0;
cur_monst->spell_note(17); cur_monst->spell_note(17);
} }
move_to_zero(cur_monst->summoned); move_to_zero(cur_monst->summon_time);
} }
} }
@@ -2473,12 +2473,12 @@ void do_monster_turn() {
} }
if(what_summon) r1 = get_ran(1, abil.summon.min, abil.summon.max); if(what_summon) r1 = get_ran(1, abil.summon.min, abil.summon.max);
else r1 = 0; else r1 = 0;
if(r1 && summon_monster(what_summon, cur_monst->cur_loc,abil.summon.len,cur_monst->attitude)) { if(r1 && summon_monster(what_summon, cur_monst->cur_loc,abil.summon.len,cur_monst->attitude,cur_monst->is_friendly())) {
cur_monst->spell_note(33); cur_monst->spell_note(33);
play_sound(61); play_sound(61);
bool failed = false; bool failed = false;
while(--r1 && !failed) { while(--r1 && !failed) {
failed = summon_monster(what_summon, cur_monst->cur_loc,abil.summon.len,cur_monst->attitude); failed = summon_monster(what_summon,cur_monst->cur_loc,abil.summon.len,cur_monst->attitude,cur_monst->is_friendly());
} }
} }
} }
@@ -3361,8 +3361,7 @@ bool monst_cast_mage(cCreature *caster,short targ) {
x = get_ran(3,1,4); x = get_ran(3,1,4);
play_sound(25); play_sound(25);
play_sound(-61); play_sound(-61);
summon_monster(r1,caster->cur_loc, summon_monster(r1,caster->cur_loc,x,caster->attitude,caster->is_friendly());
((caster->attitude % 2 != 1) ? 0 : 100) + x,caster->attitude);
break; break;
case eSpell::CONFLAGRATION: case eSpell::CONFLAGRATION:
run_a_missile(l,target,13,1,25,0,0,80); run_a_missile(l,target,13,1,25,0,0,80);
@@ -3400,8 +3399,7 @@ bool monst_cast_mage(cCreature *caster,short targ) {
x = get_ran(4,1,4); x = get_ran(4,1,4);
for(i = 0; i < j; i++){ for(i = 0; i < j; i++){
play_sound(-61); play_sound(-61);
if(!summon_monster(r1,caster->cur_loc, if(!summon_monster(r1,caster->cur_loc,x,caster->attitude,caster->is_friendly())) {
((caster->attitude % 2 != 1) ? 0 : 100) + x,caster->attitude)) {
add_string_to_buf(" Summon failed."); i = j;} add_string_to_buf(" Summon failed."); i = j;}
} }
break; break;
@@ -3473,8 +3471,7 @@ bool monst_cast_mage(cCreature *caster,short targ) {
play_sound(25); play_sound(25);
play_sound(-61); play_sound(-61);
sf::sleep(time_in_ticks(12)); // gives sound time to end sf::sleep(time_in_ticks(12)); // gives sound time to end
summon_monster(85,caster->cur_loc, summon_monster(85,caster->cur_loc,x,caster->attitude,caster->is_friendly());
((caster->attitude % 2 != 1) ? 0 : 100) + x,caster->attitude);
break; break;
case eSpell::BLESS_MAJOR: case eSpell::BLESS_MAJOR:
play_sound(25); play_sound(25);
@@ -3664,8 +3661,7 @@ bool monst_cast_priest(cCreature *caster,short targ) {
play_sound(-61); play_sound(-61);
x = get_ran(3,1,4); x = get_ran(3,1,4);
summon_monster(spell == eSpell::SUMMON_SPIRIT ? 125 : 122,caster->cur_loc, summon_monster(spell == eSpell::SUMMON_SPIRIT ? 125 : 122,caster->cur_loc,x,caster->attitude,caster->is_friendly());
((caster->attitude % 2 != 1) ? 0 : 100) + x,caster->attitude);
break; break;
case eSpell::DISEASE: case eSpell::DISEASE:
run_a_missile(l,vict_loc,11,0,24,0,0,80); run_a_missile(l,vict_loc,11,0,24,0,0,80);
@@ -3701,8 +3697,7 @@ bool monst_cast_priest(cCreature *caster,short targ) {
play_sound(-61); play_sound(-61);
r2 = get_ran(1,0,7); r2 = get_ran(1,0,7);
x = get_ran(3,1,4); x = get_ran(3,1,4);
summon_monster((r2 == 1) ? 100 : 99,caster->cur_loc, summon_monster((r2 == 1) ? 100 : 99,caster->cur_loc,x,caster->attitude,caster->is_friendly());
((caster->attitude % 2 != 1) ? 0 : 100) + x,caster->attitude);
} }
break; break;
case eSpell::MARTYRS_SHIELD: // martyr's shield case eSpell::MARTYRS_SHIELD: // martyr's shield
@@ -3713,12 +3708,10 @@ bool monst_cast_priest(cCreature *caster,short targ) {
play_sound(24); play_sound(24);
x = get_ran(3,1,4) + 1; x = get_ran(3,1,4) + 1;
play_sound(-61); play_sound(-61);
summon_monster(126,caster->cur_loc, summon_monster(126,caster->cur_loc,x,caster->attitude,caster->is_friendly());
((caster->attitude % 2 != 1) ? 0 : 100) + x,caster->attitude);
for(i = 0; i < 4; i++) { for(i = 0; i < 4; i++) {
play_sound(-61); play_sound(-61);
if(!summon_monster(125,caster->cur_loc, if(!summon_monster(125,caster->cur_loc,x,caster->attitude,caster->is_friendly()))
((caster->attitude % 2 != 1) ? 0 : 100) + x,caster->attitude))
i = 4; i = 4;
} }
break; break;

View File

@@ -381,7 +381,7 @@ void set_town_attitude(short lo,short hi,short att) {
std::swap(lo, hi); std::swap(lo, hi);
for(i = lo; i <= hi; i++) { for(i = lo; i <= hi; i++) {
if((univ.town.monst[i].active > 0) && (univ.town.monst[i].summoned == 0)){ if(univ.town.monst[i].active > 0 && univ.town.monst[i].summon_time == 0){
univ.town.monst[i].attitude = att; univ.town.monst[i].attitude = att;
num = univ.town.monst[i].number; num = univ.town.monst[i].number;
// If made hostile, make mobile // If made hostile, make mobile

View File

@@ -169,7 +169,7 @@ void set_up_monst(short mode,mon_num_t m_num) {
cMonster& monst = m_num >= 10000 ? univ.party.summons[m_num - 10000] : univ.scenario.scen_monsters[m_num]; cMonster& monst = m_num >= 10000 ? univ.party.summons[m_num - 10000] : univ.scenario.scen_monsters[m_num];
univ.town.monst.assign(which, cCreature(m_num), monst, PSD[SDF_EASY_MODE], univ.difficulty_adjust()); univ.town.monst.assign(which, cCreature(m_num), monst, PSD[SDF_EASY_MODE], univ.difficulty_adjust());
univ.town.monst[which].active = 2; univ.town.monst[which].active = 2;
univ.town.monst[which].summoned = 0; univ.town.monst[which].summon_time = 0;
univ.town.monst[which].attitude = mode + 1; univ.town.monst[which].attitude = mode + 1;
univ.town.monst[which].mobility = 1; univ.town.monst[which].mobility = 1;
} }
@@ -1250,7 +1250,7 @@ short place_monster(mon_num_t which,location where) {
univ.town.monst[i].mobility = 1; univ.town.monst[i].mobility = 1;
univ.town.monst[i].active = 2; univ.town.monst[i].active = 2;
univ.town.monst[i].cur_loc = where; univ.town.monst[i].cur_loc = where;
univ.town.monst[i].summoned = 0; univ.town.monst[i].summon_time = 0;
univ.town.monst[i].target = 6; univ.town.monst[i].target = 6;
univ.town.set_crate(where.x,where.y,false); univ.town.set_crate(where.x,where.y,false);
@@ -1263,7 +1263,7 @@ short place_monster(mon_num_t which,location where) {
// returns true if placement was successful // returns true if placement was successful
//which; // if in town, this is caster loc., if in combat, this is where to try //which; // if in town, this is caster loc., if in combat, this is where to try
// to put monster // to put monster
bool summon_monster(mon_num_t which,location where,short duration,short given_attitude) { bool summon_monster(mon_num_t which,location where,short duration,short given_attitude,bool by_party) {
location loc; location loc;
short spot; short spot;
@@ -1296,7 +1296,8 @@ bool summon_monster(mon_num_t which,location where,short duration,short given_at
univ.town.monst[spot].attitude = given_attitude; univ.town.monst[spot].attitude = given_attitude;
univ.town.monst[spot].summoned = duration; univ.town.monst[spot].summon_time = duration;
univ.town.monst[spot].party_summoned = by_party;
univ.town.monst[spot].spell_note(21); univ.town.monst[spot].spell_note(21);
return true; return true;
@@ -1314,7 +1315,7 @@ void activate_monsters(short code,short /*attitude*/) {
univ.town.monst[i].spec_enc_code = 0; univ.town.monst[i].spec_enc_code = 0;
univ.town.monst[i].active = 2; univ.town.monst[i].active = 2;
univ.town.monst[i].summoned = 0; univ.town.monst[i].summon_time = 0;
univ.town.monst[i].target = 6; univ.town.monst[i].target = 6;
univ.town.set_crate(univ.town.monst[i].cur_loc.x,univ.town.monst[i].cur_loc.y,false); univ.town.set_crate(univ.town.monst[i].cur_loc.x,univ.town.monst[i].cur_loc.y,false);

View File

@@ -33,7 +33,7 @@ void monst_inflict_fields(short which_monst);
bool monst_check_special_terrain(location where_check,short mode,short which_monst); bool monst_check_special_terrain(location where_check,short mode,short which_monst);
void record_monst(cCreature *which_m); void record_monst(cCreature *which_m);
short place_monster(mon_num_t which,location where); short place_monster(mon_num_t which,location where);
bool summon_monster(mon_num_t which,location where,short duration,short given_attitude); bool summon_monster(mon_num_t which,location where,short duration,short given_attitude,bool by_party);
void activate_monsters(short code,short attitude); void activate_monsters(short code,short attitude);
short get_encumberance(short pc_num); short get_encumberance(short pc_num);
mon_num_t get_summon_monster(short summon_class); mon_num_t get_summon_monster(short summon_class);

View File

@@ -864,7 +864,7 @@ void do_mage_spell(short pc_num,eSpell spell_num,bool freebie) {
if(!freebie) if(!freebie)
univ.party[pc_num].cur_sp -= (*spell_num).cost; univ.party[pc_num].cur_sp -= (*spell_num).cost;
store = get_ran(3,1,4) + adj; store = get_ran(3,1,4) + adj;
if(!summon_monster(r1,where,store,2)) if(!summon_monster(r1,where,store,2,true))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
break; break;
case eSpell::SUMMON_WEAK: case eSpell::SUMMON_WEAK:
@@ -876,7 +876,7 @@ void do_mage_spell(short pc_num,eSpell spell_num,bool freebie) {
univ.party[pc_num].cur_sp -= (*spell_num).cost; univ.party[pc_num].cur_sp -= (*spell_num).cost;
store = get_ran(4,1,4) + adj; store = get_ran(4,1,4) + adj;
for(i = 0; i < j; i++) for(i = 0; i < j; i++)
if(!summon_monster(r1,where,store,2)) if(!summon_monster(r1,where,store,2,true))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
break; break;
case eSpell::SUMMON: case eSpell::SUMMON:
@@ -888,7 +888,7 @@ void do_mage_spell(short pc_num,eSpell spell_num,bool freebie) {
univ.party[pc_num].cur_sp -= (*spell_num).cost; univ.party[pc_num].cur_sp -= (*spell_num).cost;
store = get_ran(5,1,4) + adj; store = get_ran(5,1,4) + adj;
for(i = 0; i < j; i++) for(i = 0; i < j; i++)
if(!summon_monster(r1,where,store,2)) if(!summon_monster(r1,where,store,2,true))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
break; break;
case eSpell::SUMMON_MAJOR: case eSpell::SUMMON_MAJOR:
@@ -900,19 +900,19 @@ void do_mage_spell(short pc_num,eSpell spell_num,bool freebie) {
univ.party[pc_num].cur_sp -= (*spell_num).cost; univ.party[pc_num].cur_sp -= (*spell_num).cost;
store = get_ran(7,1,4) + adj; store = get_ran(7,1,4) + adj;
for(i = 0; i < j; i++) for(i = 0; i < j; i++)
if(!summon_monster(r1,where,store,2)) if(!summon_monster(r1,where,store,2,true))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
break; break;
case eSpell::DEMON: case eSpell::DEMON:
store = get_ran(5,1,4) + 2 * adj; store = get_ran(5,1,4) + 2 * adj;
if(!summon_monster(85,where,store,2)) if(!summon_monster(85,where,store,2,true))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
else if(!freebie) else if(!freebie)
univ.party[pc_num].cur_sp -= (*spell_num).cost; univ.party[pc_num].cur_sp -= (*spell_num).cost;
break; break;
case eSpell::SUMMON_RAT: case eSpell::SUMMON_RAT:
store = get_ran(5,1,4) + 2 * adj; store = get_ran(5,1,4) + 2 * adj;
if(!summon_monster(80,where,store,2)) if(!summon_monster(80,where,store,2,true))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
break; break;
@@ -1063,7 +1063,7 @@ void do_priest_spell(short pc_num,eSpell spell_num,bool freebie) {
break; break;
case eSpell::SUMMON_SPIRIT: case eSpell::SUMMON_SPIRIT:
if(!summon_monster(125,where,get_ran(2,1,4) + adj,2)) if(!summon_monster(125,where,get_ran(2,1,4) + adj,2,true))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
else if(!freebie) else if(!freebie)
univ.party[pc_num].cur_sp -= (*spell_num).cost; univ.party[pc_num].cur_sp -= (*spell_num).cost;
@@ -1075,7 +1075,7 @@ void do_priest_spell(short pc_num,eSpell spell_num,bool freebie) {
for(i = 0; i < r1; i++) { for(i = 0; i < r1; i++) {
r2 = get_ran(1,0,7); r2 = get_ran(1,0,7);
store = get_ran(2,1,5) + adj; store = get_ran(2,1,5) + adj;
if(!summon_monster((r2 == 1) ? 100 : 99,where,store,2 )) if(!summon_monster((r2 == 1) ? 100 : 99,where,store,2,true))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
} }
break; break;
@@ -1083,17 +1083,17 @@ void do_priest_spell(short pc_num,eSpell spell_num,bool freebie) {
if(!freebie) if(!freebie)
univ.party[pc_num].cur_sp -= (*spell_num).cost; univ.party[pc_num].cur_sp -= (*spell_num).cost;
store = get_ran(2,1,4) + adj; store = get_ran(2,1,4) + adj;
if(!summon_monster(126,where,store,2)) if(!summon_monster(126,where,store,2,true))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
for(i = 0; i < 4; i++) { for(i = 0; i < 4; i++) {
store = get_ran(2,1,4) + adj; store = get_ran(2,1,4) + adj;
if(!summon_monster(125,where,store,2)) if(!summon_monster(125,where,store,2,true))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
} }
break; break;
case eSpell::SUMMON_GUARDIAN: case eSpell::SUMMON_GUARDIAN:
store = get_ran(6,1,4) + adj; store = get_ran(6,1,4) + adj;
if(!summon_monster(122,where,store,2)) if(!summon_monster(122,where,store,2,true))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
else if(!freebie) else if(!freebie)
univ.party[pc_num].cur_sp -= (*spell_num).cost; univ.party[pc_num].cur_sp -= (*spell_num).cost;

View File

@@ -1128,14 +1128,14 @@ void use_item(short pc,short item) {
else do_mage_spell(current_pc, spell, true); else do_mage_spell(current_pc, spell, true);
break; break;
case eItemAbil::SUMMONING: case eItemAbil::SUMMONING:
if(!summon_monster(univ.party[pc].items[item].abil_data[1],user_loc,str,2)) if(!summon_monster(univ.party[pc].items[item].abil_data[1],user_loc,str,2,true))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
break; break;
case eItemAbil::MASS_SUMMONING: case eItemAbil::MASS_SUMMONING:
r1 = get_ran(str,1,4); r1 = get_ran(str,1,4);
j = get_ran(1,3,5); j = get_ran(1,3,5);
for(i = 0; i < j; i++) for(i = 0; i < j; i++)
if(!summon_monster(univ.party[pc].items[item].abil_data[1],user_loc,r1,2)) if(!summon_monster(univ.party[pc].items[item].abil_data[1],user_loc,r1,2,true))
add_string_to_buf(" Summon failed."); add_string_to_buf(" Summon failed.");
break; break;
case eItemAbil::QUICKFIRE: case eItemAbil::QUICKFIRE:
@@ -1625,7 +1625,7 @@ void kill_monst(cCreature *which_m,short who_killed,eMainStatus type) {
if(which_m->abil[eMonstAbil::DEATH_TRIGGER].active) if(which_m->abil[eMonstAbil::DEATH_TRIGGER].active)
run_special(eSpecCtx::KILL_MONST,0,which_m->abil[eMonstAbil::DEATH_TRIGGER].special.extra1,which_m->cur_loc,&s1,&s2,&s3); run_special(eSpecCtx::KILL_MONST,0,which_m->abil[eMonstAbil::DEATH_TRIGGER].special.extra1,which_m->cur_loc,&s1,&s2,&s3);
if((!in_scen_debug) && ((which_m->summoned >= 100) || (which_m->summoned == 0))) { // no xp for party-summoned monsters if(!in_scen_debug && (which_m->summon_time == 0 || !which_m->party_summoned)) { // no xp for party-summoned monsters
xp = which_m->level * 2; xp = which_m->level * 2;
if(who_killed < 6) if(who_killed < 6)
award_xp(who_killed,xp); award_xp(who_killed,xp);
@@ -1640,7 +1640,7 @@ void kill_monst(cCreature *which_m,short who_killed,eMainStatus type) {
place_glands(l,which_m->number); place_glands(l,which_m->number);
} }
if((!in_scen_debug) && (which_m->summoned == 0)) if(!in_scen_debug && which_m->summon_time == 0)
place_treasure(which_m->cur_loc, which_m->level / 2, which_m->treasure, 0); place_treasure(which_m->cur_loc, which_m->level / 2, which_m->treasure, 0);
i = which_m->cur_loc.x; i = which_m->cur_loc.x;
@@ -1668,7 +1668,7 @@ void kill_monst(cCreature *which_m,short who_killed,eMainStatus type) {
break; break;
} }
if(((is_town()) || (which_combat_type == 1)) && (which_m->summoned == 0)) { if((is_town() || which_combat_type == 1) && which_m->summon_time == 0) {
univ.party.m_killed[univ.town.num]++; univ.party.m_killed[univ.town.num]++;
} }

View File

@@ -196,7 +196,7 @@ void start_town_mode(short which_town, short entry_dir) {
univ.town.monst[j].mp = univ.town.monst[j].max_mp; univ.town.monst[j].mp = univ.town.monst[j].max_mp;
univ.town.monst[j].morale = univ.town.monst[j].m_morale; univ.town.monst[j].morale = univ.town.monst[j].m_morale;
univ.town.monst[j].status.clear(); univ.town.monst[j].status.clear();
if(univ.town.monst[j].summoned > 0) if(univ.town.monst[j].summon_time > 0)
univ.town.monst[j].active = 0; univ.town.monst[j].active = 0;
univ.town.monst[j].target = 6; univ.town.monst[j].target = 6;
} }

View File

@@ -59,7 +59,7 @@ void cPopulation::assign(size_t n, const cTownperson& other, const cMonster& bas
dudes[n].attitude = dudes[n].start_attitude; dudes[n].attitude = dudes[n].start_attitude;
dudes[n].cur_loc = dudes[n].start_loc; dudes[n].cur_loc = dudes[n].start_loc;
dudes[n].target = 6; // No target dudes[n].target = 6; // No target
dudes[n].summoned = 0; dudes[n].summon_time = 0;
} }
void cPopulation::readFrom(std::istream& in, size_t n) { void cPopulation::readFrom(std::istream& in, size_t n) {

View File

@@ -19,7 +19,7 @@ cCreature::cCreature(){
number = active = attitude = start_attitude = 0; number = active = attitude = start_attitude = 0;
start_loc.x = start_loc.y = cur_loc.x = cur_loc.y = targ_loc.x = targ_loc.y = 80; start_loc.x = start_loc.y = cur_loc.x = cur_loc.y = targ_loc.x = targ_loc.y = 80;
mobility = 1; mobility = 1;
summoned = 0; summon_time = 0;
time_flag = eMonstTime::ALWAYS; time_flag = eMonstTime::ALWAYS;
spec1 = spec2 = spec_enc_code = time_code = monster_time = 0; spec1 = spec2 = spec_enc_code = time_code = monster_time = 0;
personality = special_on_kill = facial_pic = -1; personality = special_on_kill = facial_pic = -1;
@@ -38,7 +38,11 @@ void cCreature::append(legacy::creature_data_type old){
cur_loc.y = old.m_loc.y; cur_loc.y = old.m_loc.y;
cMonster::append(old.m_d); cMonster::append(old.m_d);
mobility = old.mobile; mobility = old.mobile;
summoned = old.summoned; summon_time = old.summoned;
if(summon_time >= 100) {
party_summoned = false;
summon_time -= 100;
} else party_summoned = true;
number = old.monst_start.number; number = old.monst_start.number;
start_attitude = old.monst_start.start_attitude; start_attitude = old.monst_start.start_attitude;
start_loc.x = old.monst_start.start_loc.x; start_loc.x = old.monst_start.start_loc.x;
@@ -192,7 +196,7 @@ void cCreature::writeTo(std::ostream& file) const {
file << "LOCATION " << cur_loc.x << ' ' << cur_loc.y << '\n'; file << "LOCATION " << cur_loc.x << ' ' << cur_loc.y << '\n';
file << "MOBILITY " << mobility << '\n'; file << "MOBILITY " << mobility << '\n';
file << "TIMEFLAG " << time_flag << '\n'; file << "TIMEFLAG " << time_flag << '\n';
file << "SUMMONED " << summoned << '\n'; file << "SUMMONED " << summon_time << ' ' << party_summoned << '\n';
file << "SPEC " << spec1 << ' ' << spec2 << '\n'; file << "SPEC " << spec1 << ' ' << spec2 << '\n';
file << "SPECCODE " << spec_enc_code << '\n'; file << "SPECCODE " << spec_enc_code << '\n';
file << "TIMECODE " << time_code << '\n'; file << "TIMECODE " << time_code << '\n';
@@ -239,7 +243,7 @@ void cCreature::readFrom(std::istream& file) {
} else if(cur == "TIMEFLAG") { } else if(cur == "TIMEFLAG") {
line >> time_flag; line >> time_flag;
} else if(cur == "SUMMONED") } else if(cur == "SUMMONED")
line >> summoned; line >> summon_time >> party_summoned;
else if(cur == "SPEC") else if(cur == "SPEC")
line >> spec1 >> spec2; line >> spec1 >> spec2;
else if(cur == "SPECCODE") { else if(cur == "SPECCODE") {

View File

@@ -20,7 +20,8 @@ public:
static const short charm_odds[20]; static const short charm_odds[20];
short active, attitude; short active, attitude;
location cur_loc; location cur_loc;
short summoned; short summon_time;
bool party_summoned;
short target; short target;
location targ_loc; location targ_loc;
short health; short health;