Example #1
0
void edit_party_event_filter (short item_hit)
{
	short which_pc;

		switch (item_hit) {
			case 1:
				dialog_not_toast = false;
				break;

			case 41:
				party.help_received[22] = 0;
				give_help(222,23,989);
				return;

			case 5: case 10: case 15: case 20: case 25: case 30:
				which_pc = (item_hit - 5) / 5;
				if (adven[which_pc].main_status != MAIN_STATUS_ABSENT)
					pick_pc_name(which_pc,989);
				put_party_stats();
				break;
			case 7: case 12: case 17: case 22: case 27: case 32:
				which_pc = (item_hit - 7) / 5;
				pick_race_abil(&adven[which_pc],0,989);
				put_party_stats();
				break;
			case 8: case 13: case 18: case 23: case 28: case 33:
				which_pc = (item_hit - 8) / 5;
				spend_xp(which_pc,0,989);
				put_party_stats();
				break;
			case 35: case 36: case 37: case 38: case 39: case 40:
				which_pc = item_hit - 35;

				if (adven[which_pc].main_status <= MAIN_STATUS_ABSENT)
					break;
				if (adven[which_pc].main_status != MAIN_STATUS_ABSENT)
					pick_pc_graphic(which_pc,1,989);
				put_party_stats();
				break;
			case 6: case 11: case 16: case 21: case 26: case 31:
				which_pc = (item_hit - 6) / 5;
				if (adven[which_pc].main_status != MAIN_STATUS_ABSENT) {
					if (FCD(1053,989) == 2)
						adven[which_pc].main_status = MAIN_STATUS_ABSENT;
					put_party_stats();
					}
					else {
						give_help(56,0,989);
						create_pc(which_pc,989);
						put_party_stats();
						cd_initial_draw(989); // extra redraw, just in case
						}
				break;
//			case 7: case 12: case 17: case 22: case 27: case 32:

			}

}
Example #2
0
bool handle_action(sf::Event event) {
	short i;
	
	location the_point;
	
	bool to_return = false;
	
	the_point = {event.mouseButton.x, event.mouseButton.y};
	
	if(file_in_mem.empty())
		return false;
	
	for(i = 0; i < 6; i++)
		if((the_point.in(pc_area_buttons[i][0])) &&
		   (univ.party[i].main_status != eMainStatus::ABSENT)) {
			do_button_action(0,i);
			current_active_pc = i;
			redraw_screen();
		}
	for(i = 0; i < 5; i++)
		if((the_point.in(edit_rect[i])) &&
		   (univ.party[current_active_pc].main_status != eMainStatus::ABSENT)) {
			do_button_action(0,i + 10);
			switch(i) {
				case 0:
					display_pc(current_active_pc,10,nullptr);
					break;
				case 1:
			 		display_pc(current_active_pc,11,nullptr);
					break;
				case 2:
					pick_race_abil(&univ.party[current_active_pc],0);
					break;
				case 3:
					spend_xp(current_active_pc,2,nullptr);
					break;
				case 4:
					edit_xp(&univ.party[current_active_pc]);
					
					break;
			}
		}
	for(i = 0; i < 24; i++)
		if((the_point.in(item_string_rects[i][1])) && // drop item
		   univ.party[current_active_pc].items[i].variety != eItemType::NO_ITEM) {
			flash_rect(item_string_rects[i][1]);
			univ.party[current_active_pc].take_item(i);
		}
	for(i = 0; i < 24; i++)
		if((the_point.in(item_string_rects[i][2])) && // identify item
		   univ.party[current_active_pc].items[i].variety != eItemType::NO_ITEM) {
			flash_rect(item_string_rects[i][2]);
			univ.party[current_active_pc].items[i].ident = true;
		}
	
	return to_return;
}
Example #3
0
void give_pc_info_event_filter(short item_hit)
{
	short pc;

	pc = store_pc_num;
	switch (item_hit) {
		case 1: 
			toast_dialog();
			break;
		case 2: 
			do				
				store_pc_num = (store_pc_num == 0) ? 5 : store_pc_num - 1;
				while (univ.party[store_pc_num].main_status != 1);
			display_pc_info();
			break;
		case 3: 
			do 
				store_pc_num = (store_pc_num + 1) % 6;
				while (univ.party[store_pc_num].main_status != 1);
			display_pc_info();
			break;
		case 4:
			display_pc(pc,0,1019);
			break;
		case 5:
			display_pc(pc,1,1019);
			break;
		case 6:
			pick_race_abil(&univ.party[pc],1,1019);
			break;
		case 68:
			display_alchemy();
			break;
		}	

}
Example #4
0
//extern Rect pc_area_buttons[6][6] ; // 0 - whole 1 - pic 2 - name 3 - stat strs 4,5 - later
//extern Rect item_string_rects[24][4]; // 0 - name 1 - drop  2 - id  3 - 
bool handle_action(EventRecord event,short mode)
//short mode; // ignore,
{
	short i;
	
	Point the_point;
	short choice = 4;
	
	bool to_return = false;

	the_point = event.where;
	GlobalToLocal(&the_point);	

	if (file_in_mem == false) 
		return false;
		
	for (i = 0; i < 6; i++)
		if ((PtInRect(the_point,&pc_area_buttons[i][0]) == true) &&
			(univ.party[i].main_status > 0)) {
			do_button_action(0,i);
			current_active_pc = i;
			display_party(6,1);
			draw_items(1);
			}
	for (i = 0; i < 5; i++)
		if ((PtInRect(the_point,&edit_rect[i][0]) == true) &&
			(univ.party[current_active_pc].main_status > 0)) {
			do_button_action(0,i + 10);
			if (save_blocked == false)
				if ((choice = FCD(904,0)) == 1)
					return to_return;
					else save_blocked = true;
			switch(i) {
				case 0:
					display_pc(current_active_pc,0,0);
					break;
				case 1:
			 		display_pc(current_active_pc,1,0);
					break;
				case 2: 
					pick_race_abil(&univ.party[current_active_pc],0,0);
					break;
				case 3: 
					spend_xp(current_active_pc,1,0);
					break;
				case 4: 
					edit_xp(&univ.party[current_active_pc]);
					
					break;
			}
		}
	for (i = 0; i < 24; i++)
		if ((PtInRect(the_point,&item_string_rects[i][1]) == true) && // drop item
			(univ.party[current_active_pc].items[i].variety > 0)) { // variety = 0 no item in slot/ non 0 item exists
				flash_rect(item_string_rects[i][1]);
				take_item(current_active_pc,i);
				draw_items(1);
				}
	for (i = 0; i < 24; i++)
		if ((PtInRect(the_point,&item_string_rects[i][2]) == true) && // identify item
			(univ.party[current_active_pc].items[i].variety > 0)) {
				flash_rect(item_string_rects[i][2]);
				univ.party[current_active_pc].items[i].ident = true;
				draw_items(1);
				}
	
	return to_return;
}