Beispiel #1
0
void edit_party()
{

	SetCursor(sword_curs);

	cd_create_dialog(989,mainPtr);

	put_party_stats();
	if (party.help_received[22] == 0) {
		cd_initial_draw(989);
		give_help(22,23,989);
		}
	while (dialog_not_toast)
		ModalDialog();
	cd_kill_dialog(989,0);

	if (adven[current_pc].isAlive() == false)
		current_pc = first_active_pc();


}
Beispiel #2
0
void draw_party_symbol(location center) {
	rectangle source_rect;
	location target(4,4);
	short i = 0;
	
	if(!can_draw_pcs)
		return;
	if(!univ.party.is_alive())
		return;
	if((is_town()) && (univ.town.p_loc.x > 70))
		return;
	if(overall_mode == MODE_LOOK_TOWN || cartoon_happening) {
		target.x += univ.town.p_loc.x - center.x;
		target.y += univ.town.p_loc.y - center.y;
	}
	
	if((univ.party.in_boat < 0) && (univ.party.in_horse < 0)) {
		i = first_active_pc();
		sf::Texture* from_gw;
		pic_num_t pic = univ.party[i].which_graphic;
		if(pic >= 1000) {
			bool isParty = pic >= 10000;
			pic_num_t need_pic = pic % 1000;
			if(univ.party.direction >= 4)
				need_pic++;
			graf_pos_ref(from_gw, source_rect) = spec_scen_g.find_graphic(need_pic, isParty);
		} else if(pic >= 100) {
			// Note that we assume it's a 1x1 graphic.
			// PCs can't be larger than that, but we leave it to the scenario designer to avoid assigning larger graphics.
			pic_num_t need_pic = pic - 100;
			int mode = 0;
			if(univ.party.direction >= 4)
				mode++;
			source_rect = get_monster_template_rect(need_pic, mode, 0);
			int which_sheet = m_pic_index[need_pic].i / 20;
			from_gw = ResMgr::get<ImageRsrc>("monst" + std::to_string(1 + which_sheet)).get();
		} else {
			source_rect = calc_rect(2 * (pic / 8), pic % 8);
			if(univ.party.direction >= 4)
				source_rect.offset(28,0);
			from_gw = ResMgr::get<ImageRsrc>("pcs").get();
		}
		ter_num_t ter = 0;
		if(is_out())
			ter = univ.out[univ.party.p_loc.x][univ.party.p_loc.y];
		else if(is_town() || is_combat())
			ter = univ.town->terrain(univ.town.p_loc.x,univ.town.p_loc.y);
		// now wedge in bed graphic
		if(is_town() && univ.scenario.ter_types[ter].special == eTerSpec::BED)
			draw_one_terrain_spot((short) target.x,(short) target.y,10000 + univ.scenario.ter_types[ter].flag1);
		else Draw_Some_Item(*from_gw, source_rect, terrain_screen_gworld, target, 1, 0);
	}
	else if(univ.party.in_boat >= 0) {
		if(univ.party.direction == DIR_N) i = 2;
		else if(univ.party.direction == DIR_S) i = 3;
		else i = univ.party.direction > DIR_S;
		Draw_Some_Item(*ResMgr::get<ImageRsrc>("vehicle"), calc_rect(i,0), terrain_screen_gworld, target, 1, 0);
	}else {
		i = univ.party.direction > 3;
		Draw_Some_Item(*ResMgr::get<ImageRsrc>("vehicle"), calc_rect(i + 2, 1), terrain_screen_gworld, target, 1, 0);
	}
}
Beispiel #3
0
void pc_record_type::kill(short type)
{
	short i = 24;
	bool dummy, no_save = false, no_luck = false;
	location item_loc;

	if (type >= 20)
	{
		type -= 10;
		no_save = true;
	}
    if(type >= 10)
    {
    	type -= 10;
	    no_luck = true;
    }

    if(no_save == false){
	if (type != 4)
		i = hasAbilEquip(ITEM_LIFE_SAVING); //check if has life saving items
    else
	    i = hasAbilEquip(ITEM_PROTECT_FROM_PETRIFY); //check if has protection vs petrification items
    }

	short which_pc = getNum();

	if ((no_luck == false) && (type != 0) && (skills[SKILL_LUCK] > 0) &&
		(get_ran(1,0,100) < hit_chance[skills[SKILL_LUCK]])) {
			add_string_to_buf("  But you luck out!          ");
			cur_health = 0;
			}
		else if ((i == 24) || (type == 0)) {
			if (combat_active_pc == which_pc)
				combat_active_pc = 6;

			for (i = 0; i < 24; i++)
				equip[i] = false;

			item_loc = (overall_mode >= MODE_COMBAT) ? pc_pos[which_pc] : c_town.p_loc;

			if (type == 2)
				make_sfx(item_loc.x,item_loc.y,3);
				else if (type == 3)
					make_sfx(item_loc.x,item_loc.y,6);

			if (overall_mode != MODE_OUTDOORS)
				for (i = 0; i < 24; i++)
					if (items[i].variety != ITEM_TYPE_NO_ITEM) {
						dummy = place_item(items[i],item_loc,true);
						items[i].variety = ITEM_TYPE_NO_ITEM;
						}
				if ((type == 2) || (type == 3))
					play_sound(21);
				if(type == 4){
                    play_sound(43);
                    sprintf (create_line, "  %s is turned to stone.                  ",(char *) name);
					add_string_to_buf(create_line);
                    }
				main_status = type;
				pc_moves[which_pc] = 0;
			}
			else {
                if (type == 4) {
                  sprintf (create_line, "  %s is immune to petrification.                  ",(char *) name);
                  add_string_to_buf(create_line); //inform of what has happened
                                    }
                else{
				add_string_to_buf("  Life saved!              ");
				takeItem(i);
				heal(200);
               }
            }

        current_pc = first_active_pc();

	if (current_pc > 5) {
		for (i = 0; i < NUM_OF_PCS; i++)
			if (adven[i].status > 0)
				current_pc = i;
		}

	put_pc_screen();
	set_stat_window(current_pc);
}