Ejemplo n.º 1
0
int sl_handle_button(int button, OBJECT *tree, SLIDER *sl, XDINFO *dialog)
{
	int button2 = button & 0x7FFF;

	if ((button2 == sl->up_arrow) || (button2 == sl->down_arrow))
		do_arrows(button2, tree, sl, dialog);
	else if (button2 == sl->slider)
	{
		do_slider(tree, sl, dialog);
		(*sl->set_selector) (sl, TRUE, dialog);
	}
	else if (button2 == sl->sparent)
		do_bar(tree, sl, dialog);
	else
		return FALSE;

	return TRUE;
}
Ejemplo n.º 2
0
int cmd_status() {

    string msg_level, sb, tmp;
    int exp, lev_exp, lev_perc;
    if(this_player()->query_race() == "" || !this_player()->query_race())
	return notify_fail("You must first choose a race!\n");


    exp = (int)this_player()->query_exp();
    lev_exp = (int)ADVANCE_D->get_exp((int)this_player()->query_level()+1);

    lev_perc = percent(exp,lev_exp);
    if (lev_perc >= 100)
	msg_level = "0%%^BOLD%^[%^BLUE%^||||||||||||||||||||%^WHITE%^]%^RESET%^100%";
    if (lev_perc <= 99)
	msg_level = "0%%^BOLD%^[%^BLUE%^|||||||||||||||||||%^BLACK%^.%^WHITE%^]%^RESET%^100%";
    if (lev_perc <= 95)
	msg_level = "0%%^BOLD%^[%^BLUE%^|||||||||||||||||||%^BLACK%^.%^WHITE%^]%^RESET%^100%";
    if (lev_perc <= 90)
	msg_level = "0%%^BOLD%^[%^BLUE%^||||||||||||||||||%^BLACK%^..%^WHITE%^]%^RESET%^100%";
    if (lev_perc <= 85)
	msg_level = "0%%^BOLD%^[%^BLUE%^|||||||||||||||||%^BLACK%^...%^WHITE%^]%^RESET%^100%";
    if (lev_perc <= 80)
	msg_level = "0%%^BOLD%^[%^BLUE%^||||||||||||||||%^BLACK%^....%^WHITE%^]%^RESET%^100%";
    if (lev_perc <= 75)
	msg_level = "0%%^BOLD%^[%^BLUE%^|||||||||||||||%^BLACK%^.....%^WHITE%^]%^RESET%^100%";
    if (lev_perc <= 70)
	msg_level = "0%%^BOLD%^[%^BLUE%^||||||||||||||%^BLACK%^......%^WHITE%^]%^RESET%^100%";
    if (lev_perc <= 65)
	msg_level = "0%%^BOLD%^[%^BLUE%^|||||||||||||%^BLACK%^.......%^WHITE%^]%^RESET%^100%";
    if (lev_perc <= 60)
	msg_level = "0%%^BOLD%^[%^BLUE%^||||||||||||%^BLACK%^........%^WHITE%^]%^RESET%^100%";
    if (lev_perc <= 55)
	msg_level = "0%%^BOLD%^[%^BLUE%^|||||||||||%^BLACK%^.........%^WHITE%^]%^RESET%^100%";
    if (lev_perc <= 50)
	msg_level = "0%%^BOLD%^[%^BLUE%^||||||||||%^BLACK%^..........%^WHITE%^]%^RESET%^100%";
    if (lev_perc <= 45)
	msg_level = "0%%^BOLD%^[%^BLUE%^|||||||||%^BLACK%^............%^WHITE%^]%^RESET%^100%";
    if (lev_perc <= 40)
	msg_level = "0%%^BOLD%^[%^BLUE%^||||||||%^BLACK%^.............%^WHITE%^]%^RESET%^100%";
    if (lev_perc <= 35)
	msg_level = "0%%^BOLD%^[%^BLUE%^|||||||%^BLACK%^..............%^WHITE%^]%^RESET%^100%";
    if (lev_perc <= 30)
	msg_level = "0%%^BOLD%^[%^BLUE%^||||||%^BLACK%^...............%^WHITE%^]%^RESET%^100%";
    if (lev_perc <= 25)
	msg_level = "0%%^BOLD%^[%^BLUE%^|||||%^BLACK%^................%^WHITE%^]%^RESET%^100%";
    if (lev_perc <= 20)
	msg_level = "0%%^BOLD%^[%^BLUE%^||||%^BLACK%^.................%^WHITE%^]%^RESET%^100%";
    if (lev_perc <= 15)
	msg_level = "0%%^BOLD%^[%^BLUE%^|||%^BLACK%^..................%^WHITE%^]%^RESET%^100%";
    if (lev_perc <= 10)
	msg_level = "0%%^BOLD%^[%^BLUE%^||%^BLACK%^..................%^WHITE%^]%^RESET%^100%";
    if (lev_perc <= 5)
	msg_level = "0%%^BOLD%^[%^BLUE%^|%^BLACK%^...................%^WHITE%^]%^RESET%^100%";
    if (lev_perc <= 1)
	msg_level = "0%%^BOLD%^[%^BLACK%^....................%^WHITE%^]%^RESET%^100%";

    write("%^BLUE%^=+=+=%^BOLD%^(%^WHITE%^ Status %^BLUE%^)%^RESET%^%^BLUE%^=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+");
    tmp="%^RED%^%^BOLD%^hp%^RESET%^: "+this_player()->query_hp()+"/"+this_player()->query_max_hp()+"  "
      "%^CYAN%^%^BOLD%^sp%^RESET%^: "+this_player()->query_sp()+"/"+this_player()->query_max_sp()+"  "
      "%^MAGENTA%^%^BOLD%^mp%^RESET%^: "+this_player()->query_mp()+"/"+this_player()->query_max_mp()+"  ";
      tmp += "%^BLUE%^%^BOLD%^level%^RESET%^: "+this_player()->query_level();
    write(tmp);
    if (this_player()->query_healing_formula()) {
    write("%^BLUE%^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%^RESET%^");
    sb = arrange_string("%^BOLD%^%^MAGENTA%^Intoxicated : %^RESET%^", 14);
    sb += arrange_string(do_bar(this_player()->query_intox(), this_player()->query_healing_formula()), 23);
    sb += arrange_string("%^BOLD%^%^MAGENTA%^Stuffed     : %^RESET%^", 14);
    sb +=  do_bar(this_player()->query_stuffed(), this_player()->query_healing_formula());
    write(sb);
    sb = arrange_string("%^BOLD%^%^MAGENTA%^Quenched    : %^RESET%^", 14);
    sb += arrange_string(do_bar(this_player()->query_quenched(), this_player()->query_healing_formula()), 23);
    sb += arrange_string("%^BOLD%^%^MAGENTA%^Poisoned    : %^WHITE%^%^BOLD%^[", 17);
    if (this_player()->query_poisoning())
	sb +="%^RED%^%^BOLD%^%^FLASH%^Yes!%^RESET%^%^BOLD%^]%^RESET%^";
    else sb += "%^RESET%^No  %^BOLD%^]%^RESET%^";
    write(sb);
    }
    write("%^BLUE%^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%^RESET%^");
    write("%^BOLD%^%^MAGENTA%^Experience to next level:%^RESET%^ "+ msg_level +"%^RESET%^");
    write("%^BLUE%^=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=\n");
    return 1;
}
Ejemplo n.º 3
0
void title_screen(void){
	char j,k,choice;

	while(1){
		stop = 1;
		players = team = demo = choice = tt = 0;
		init_msx(2);
		title_irq();
		cursor_off();
		memmove((char*)0xd800,(char*)(&bmp_data + LINES*40 + LINES*320),LINES*40);
//		memset((char*)0xcea8,0xff,40);
		fill();
		revers(1);
		textcolor(1); cputsxy(12,18,	"one player game");
		textcolor(2); cputsxy(12,19,	"two player team");
		textcolor(7); cputsxy(11,20,	"two player battle");
		textcolor(2); cputsxy(15,21,	"highscores");
//		textcolor(1); cputsxy(18,22,	"demo");

		while (!demo){
			do_bar(choice);
			j = *(char*)0xdc00;
			if (j == 111)
				break;
			
			if (j == 126){
				if (choice){
					for (k=0;k<8;++k){
						do_bar(--choice);
					}
				}
			}			
			else if (j == 125){
				if (choice < 24){
					for (k=0;k<8;++k){
						do_bar(++choice);
					}
				}
			}
		}
		if (demo)			
			break;
		choice>>=3;
		
		if (choice == 1){
			team = 1;
		}
		else if (choice == 2){
			players = 1;
		}
		else if (choice == 3){
			game_irq();
			show_highscores();
			continue;
		}
		break;
	}
	fld(17);
	while (!fld_done);
	game_irq();
//	gfx_mode();
	fill();
	*(char*)0xd016 = 0x10;
	delay (35);
	if (demo){
		txt_mode();
		print2x2_centered("demo mode",7,8,10);
		delay(255);
	}
}