亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? peopleclass.h

?? RPG小游戲
?? H
字號:

#include <time.h>

class people				//抽象基類
{
protected:
	int life;
	int level;
	int attack;
	int recovery;
	int experience;
	int x;
	int y;
	int speed;

	int direction;
	int count_picture;
	int count;
	int width;
	int height;
public:
    LPDIRECTDRAWSURFACE7 lpdds1[4][3];
	
	people(int,int,int,int,int,int,int,int);
//	people(){}
	void position();
	int get_attack();
	int get_x();
	int get_y();
	void set_xy(int tx ,int ty);
	int set_direction(int);
	int set_count_picture(int);
	void show();
	virtual void attack_fuction(people&)=0;
	virtual void hurt(int)=0;
	int get_life();
	int get_level();
	void show_fight_effect();
	void free_walk(int **a);
	void set_WH(int w,int h);
	int get_W(){return width;}
	int get_H(){return height;}
	void set_att(int a){attack=a;}
	void set_rec(int a){recovery=a;}
	int get_rec(){return recovery;}

};  



class enchanter:public people
{
protected:
	int magic;
public:
	enchanter(int tlife,int tlevel,int tattack,int trecovery,
			   int texperience,int tx,int ty,int tspeed,
			   int tmagic);
	virtual void attack_fuction(people&);
	virtual void hurt(int);
};


class warrior:public people
{
public:
//	warrior(): people()
//	{}
	warrior(int tlife,int tlevel,int tattack,int trecovery,
			   int texperience,int tx,int ty,int tspeed);
	virtual void attack_fuction(people&);
	virtual void hurt(int);
};



class houyi:public warrior
{
private:
	int max_life;
public:
	houyi(int tlife,int tlevel,int tattack,int trecovery,
			   int texperience,int tx,int ty,int tspeed);
	LPDIRECTDRAWSURFACE7 lpdds[4][5];
	void DrawPeople(int **);
	virtual void attack_fuction(people&);
	virtual void hurt(int);
	void show();
	void set_experience(int b);
	void levelup();
	void show_fight_effect();
	void position();
	void setlife(int lf){life+=lf;if(life>max_life)life=max_life;}
	int get_max_life(){return max_life;}
	void set_max_life(int a){max_life=a;}
	int get_exp(){return experience;}

protected:
};


void people::position()
{
	DDraw_Draw_Surface(lpdds1[direction][count_picture],x,y,get_W(),get_H(),lpddsback,1);
	
}
void people::set_WH(int w, int h)
{
	width=w;
	height=h;
}
void people::free_walk(int **a)
{
	int x1=x,y1=y;
	count++;
	srand(time(NULL));
	if(count%10==0)
	{
		direction=(rand()+life)%4;
	}
	if(direction==0)
	{
		y1-=speed;
		count_picture++;
		if(count_picture>2)count_picture=0;

	}
	if(direction==1)
	{
		x1+=speed;
		count_picture++;
		if(count_picture>2)count_picture=0;
	}
	if(direction==2)
	{
		y1+=speed;
		count_picture++;
		if(count_picture>2)count_picture=0;
	}
	if(direction==3)
	{
		x1-=speed;
		count_picture++;
		if(count_picture>2)count_picture=0;
	}
	if(bump(x1,y1,a))
	{
		x=x1;
		y=y1;
	}
	else
		direction=rand()%4;
	DDraw_Draw_Surface((*this).lpdds1[direction][count_picture],get_x(),get_y(), get_W(),get_H(), lpddsback,1);


}

people::people(int tlife,int tlevel,int tattack,int trecovery,
			   int texperience,int tx,int ty,int tspeed)
{
	life=tlife;
	level=tlevel;
	attack=tattack;
	recovery=trecovery;
	experience=texperience;
	x=tx;
	y=ty;
	speed=tspeed;
}


houyi::houyi(int tlife,int tlevel,int tattack,int trecovery,
			 int texperience,int tx,int ty,int tspeed):warrior(tlife,
			 tlevel,tattack,trecovery,texperience,tx,ty,tspeed)
{
	max_life=20;
}


void people::show_fight_effect()
{
}


inline  int people::get_attack()
{
	return attack;
}

inline int people::get_level()
{
	return level;
}

inline int people::get_life()
{
	return life;
}

void people::show()
{
	// 732 516  life
	//       557 attack
	//       586 防
	//615 level
//	DDraw_Text_GDI("haha",732,516,150,lpddsback);
	char **a;
	a=(char**)malloc(4*sizeof(char*));
	for(int i=0;i<4;i++)
		a[i]=(char*)malloc(10);
	a[0]=_itoa(life,a[0],10);
	a[1]=_itoa(attack,a[1],10);
	a[2]=_itoa(recovery,a[2],10);
	a[3]=_itoa(level,a[3],10);
	Draw_Text_GDI(a[0],736,516,150,lpddsback);
	Draw_Text_GDI(a[1],736,557,150,lpddsback);
	Draw_Text_GDI(a[2],736,587,150,lpddsback);
	Draw_Text_GDI(a[3],736,615,150,lpddsback);


	for(i=0;i<4;i++)
		free(a[i]);
	free(a);
}

inline void people::set_xy(int tx,int ty)
{
	x=tx;
	y=ty;
}


inline int people::get_x()
{
	return x;
}

inline int people::get_y()
{
	return y;
}

void houyi::DrawPeople(int **a)
{
	int x1=x,y1=y;
	if(KEYDOWN(VK_LEFT))
	{
		x1-=speed;
		direction=1;
		count_picture++;
		if(count_picture>4)count_picture=1;
	}
	if(KEYDOWN(VK_RIGHT))
	{
		x1+=speed;
		direction=3;
		count_picture++;
		if(count_picture>4)count_picture=1;
	}
	if(KEYDOWN(VK_UP))
	{
		y1-=speed;
		direction=2;
		count_picture++;
		if(count_picture>4)count_picture=1;
	}
	if(KEYDOWN(VK_DOWN))
	{
		y1+=speed;
		direction=0;
		count_picture++;
		if(count_picture>4)count_picture=1;
	}
	if(bump(x1,y1,a))
	{
		x=x1;
		y=y1;
	}

	DDraw_Draw_Surface((*this).lpdds[direction][count_picture],get_x(),get_y(), 120,120, lpddsback,1);
}




enchanter::enchanter(int tlife,int tlevel,int tattack,int trecovery,
			   int texperience,int tx,int ty,int tspeed,
			   int tmagic)
			   :people(tlife,tlevel,tattack, trecovery,
			    texperience, tx, ty, tspeed)
{
	magic=tmagic;
}


void enchanter::attack_fuction(people& a)
{
	a.hurt(a.get_attack());
	experience+=level*attack;
}


void enchanter::hurt(int b)
{
	srand(time(NULL));
	life-=b*(rand()%41+80)/100-recovery;
	if(life<=0)
		life=0;
}


warrior::warrior(int tlife,int tlevel,int tattack,int trecovery,
			   int texperience,int tx,int ty,int tspeed)
			   :people(tlife,tlevel,tattack, trecovery,
			    texperience, tx, ty, tspeed)
{
}

void warrior::attack_fuction(people& a)
{
	PlaySound(MAKEINTRESOURCE(IDR_WAVE1),hinstance_app,SND_ASYNC|SND_RESOURCE);
	Sleep(500);
	PlaySound(MAKEINTRESOURCE(IDR_WAVE5),hinstance_app,SND_ASYNC|SND_RESOURCE);

	a.hurt(this->get_attack());
	a.show();
	experience+=level*attack;

}

void warrior::hurt(int b)
{
	srand(time(NULL));
	int k=b*(rand()%41+80)/100-recovery; 
	if(k<=0)
		k=1;
	life-=k;
	if(life<=0)
		life=0;
}

void houyi::attack_fuction(people& a)
{
	a.hurt(this->attack);
	a.show();
	DDraw_Draw_Surface(lpddsbackground[0],0,0,1024,768,lpddsback,0);

//	DDraw_Draw_Surface(background,0,0,SCREEN_WIDTH,SCREEN_HEIGHT,lpddsback,0);

	PlaySound(MAKEINTRESOURCE(IDR_WAVE1),hinstance_app,SND_ASYNC|SND_RESOURCE);
	Sleep(500);
	PlaySound(MAKEINTRESOURCE(IDR_WAVE4),hinstance_app,SND_ASYNC|SND_RESOURCE);
	Sleep(500);
//	experience+=a.level*5;
//	levelup();
	show_fight_effect();

}

void houyi::hurt(int b)
{

	srand(time(NULL));
	int k= b*(rand()%41+80)/100-recovery;;
	if( k  <=0)
		k=1;
	life-=k;
	if(life<=0)
		life=0;
	
}

void houyi::show()
{
	char **a;
	a=(char**)malloc(4*sizeof(char*));
	for(int i=0;i<4;i++)
		a[i]=(char*)malloc(10);
	a[0]=_itoa(life,a[0],10);
	a[1]=_itoa(attack,a[1],10);
	a[2]=_itoa(recovery,a[2],10);
	a[3]=_itoa(level,a[3],10);
	Draw_Text_GDI(a[0],323,516,150,lpddsback);
	Draw_Text_GDI(a[1],323,557,150,lpddsback);
	Draw_Text_GDI(a[2],323,587,150,lpddsback);
	Draw_Text_GDI(a[3],323,615,150,lpddsback);


	for(i=0;i<4;i++)
		free(a[i]);
	free(a);


}

void houyi::set_experience(int b)
{
	experience+=(30+b*20);
}

void houyi::levelup()
{
	int a=level*10+50;
	if(experience>=a)
	{
		level+=(int)experience/a;
		experience=experience%a;
		attack+=3;
		recovery+=2;
		max_life+=level*10;
	}
}


void houyi::show_fight_effect()
{
/*	int x=696,y=381,k=0;
	while(x<815)
	{
	//	k++;
	//	if(k%10==0)
			x+=1; 
		DDraw_Draw_Surface(fight_effect[0],x,y,100,100,lpddsback,1);
			DDraw_Draw_Surface(lpddsbackground[0],0,0,1024,768,lpddsback,0);

		Sleep(10);
		
	}
	*/
}


void houyi::position()
{

	DDraw_Draw_Surface(lpdds[direction][count_picture],x,y,120,120,lpddsback,1);
	

}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99re6这里只有精品视频在线观看| 日本福利一区二区| 成人午夜av电影| 欧美最猛性xxxxx直播| 精品粉嫩aⅴ一区二区三区四区| 久久久精品中文字幕麻豆发布| 一区二区免费视频| 国产精品亚洲人在线观看| 色综合久久六月婷婷中文字幕| 日韩视频中午一区| 亚洲免费毛片网站| 国产91精品免费| 欧美一区二区三区四区五区| 综合精品久久久| 久久99久久精品| 69堂成人精品免费视频| 亚洲天堂网中文字| 丰满少妇在线播放bd日韩电影| 7777精品伊人久久久大香线蕉超级流畅 | 色噜噜狠狠色综合中国| 26uuu久久综合| 首页综合国产亚洲丝袜| 一本到高清视频免费精品| 久久亚洲精品小早川怜子| 日本成人在线一区| 这里只有精品免费| 日韩制服丝袜先锋影音| 欧美系列日韩一区| 亚洲国产日韩av| 欧美亚洲一区三区| 亚洲黄色录像片| 91啦中文在线观看| 亚洲狼人国产精品| 一本久久a久久免费精品不卡| 18欧美乱大交hd1984| 成人午夜免费视频| 国产日韩欧美在线一区| 国产中文字幕精品| 久久夜色精品一区| 国产高清亚洲一区| 国产精品久久一级| 99综合影院在线| 亚洲精品日韩综合观看成人91| 色94色欧美sute亚洲线路一ni | 伊人夜夜躁av伊人久久| 色综合久久天天综合网| 一区二区三区欧美视频| 欧美一区二区大片| 日本欧美久久久久免费播放网| 日韩一级片网址| 国产精品888| 一区二区中文字幕在线| 色欲综合视频天天天| 亚洲成av人片一区二区三区| 91精品国产综合久久精品性色| 日本不卡不码高清免费观看| 精品捆绑美女sm三区| 国产精品一区免费在线观看| 中文字幕在线一区免费| 91国产丝袜在线播放| 秋霞影院一区二区| 国产欧美日本一区视频| 91成人免费在线| 麻豆国产一区二区| 国产精品剧情在线亚洲| 欧洲激情一区二区| 狠狠狠色丁香婷婷综合久久五月| 国产精品丝袜在线| 欧美日韩精品欧美日韩精品一| 麻豆专区一区二区三区四区五区| 欧美国产日韩a欧美在线观看| 色婷婷亚洲精品| 精品制服美女久久| 亚洲免费色视频| www激情久久| 欧美三级电影精品| 国产精品一区二区视频| 亚洲综合色在线| 国产亚洲欧美一级| 在线不卡欧美精品一区二区三区| 国产精品1区二区.| 午夜精品视频一区| 中文字幕一区二区三区av | 成人精品免费网站| 午夜精品久久久久久久久久久| 26uuu国产电影一区二区| 在线亚洲高清视频| 国产91丝袜在线观看| 日韩中文字幕亚洲一区二区va在线 | 国产精品视频在线看| 欧美日韩午夜在线| a美女胸又www黄视频久久| 麻豆久久一区二区| 午夜精品一区在线观看| 欧美国产一区二区在线观看| 日韩一区二区电影网| 在线精品亚洲一区二区不卡| 国产福利一区二区三区视频在线 | 亚洲一区二区三区免费视频| 亚洲国产精品传媒在线观看| 欧美一区二区三区色| 91黄色免费网站| 91网站最新网址| 成人激情免费网站| 国产精品亚洲午夜一区二区三区| 男男gaygay亚洲| 轻轻草成人在线| 亚洲一二三四区不卡| 亚洲视频在线一区二区| 国产色91在线| 国产欧美日韩不卡| 国产精品―色哟哟| 国产人成亚洲第一网站在线播放| 精品国产一区久久| 欧美成人精品高清在线播放| 日韩一区二区三区免费看| 欧美日韩在线播放| 欧美日韩国产高清一区二区三区| 91电影在线观看| 欧美色欧美亚洲另类二区| 日本乱人伦aⅴ精品| 色综合天天综合在线视频| 91网址在线看| 欧美午夜精品久久久久久孕妇| 在线观看成人小视频| 欧美一a一片一级一片| 欧美视频在线观看一区| 欧美日韩国产影片| 欧美一区二区视频在线观看2022| 欧美精品久久一区二区三区| 91精品国产91久久综合桃花| 日韩欧美另类在线| 久久久久综合网| 中文字幕日韩一区二区| 奇米影视一区二区三区小说| 久久99精品久久久| 老司机精品视频导航| 国产成人午夜视频| 一本高清dvd不卡在线观看| 欧美中文字幕久久| 91精品国产黑色紧身裤美女| 久久老女人爱爱| 亚洲美女在线一区| 日本不卡的三区四区五区| 国产精品中文字幕日韩精品| 91亚洲精品乱码久久久久久蜜桃| 在线观看视频一区二区 | 欧美日韩一区国产| 精品国产乱子伦一区| 国产精品久久久久久久岛一牛影视| 亚洲美女少妇撒尿| 美腿丝袜亚洲色图| 99九九99九九九视频精品| 欧美精品 日韩| 国产女人18毛片水真多成人如厕| 亚洲精品老司机| 久久机这里只有精品| 成人精品视频一区| 日韩午夜激情视频| 亚洲免费高清视频在线| 久久69国产一区二区蜜臀| 99在线精品免费| 欧美大胆一级视频| 亚洲美女屁股眼交| 国产一区二区网址| 欧美精品第1页| 中文字幕一区免费在线观看| 久久不见久久见免费视频1| av一区二区久久| 精品欧美一区二区久久| 一区二区三区四区在线| 国产呦萝稀缺另类资源| 欧美丝袜自拍制服另类| 国产偷国产偷亚洲高清人白洁 | 欧美三级一区二区| 中文字幕第一区第二区| 蜜桃视频免费观看一区| 91国偷自产一区二区开放时间 | 激情综合网av| 欧美精品电影在线播放| 亚洲另类色综合网站| 国产成人免费视频网站高清观看视频| 欧美日韩小视频| 亚洲一区二区精品视频| 成人动漫精品一区二区| 精品久久国产字幕高潮| 首页欧美精品中文字幕| 欧美怡红院视频| 亚洲激情欧美激情| 91亚洲资源网| 亚洲特黄一级片| 99久久精品99国产精品| 国产日韩欧美不卡在线| 国产在线麻豆精品观看| 日韩三级免费观看| 免费观看在线综合色| 欧美一区二区三区在| 婷婷六月综合亚洲| 在线不卡中文字幕播放| 日韩va欧美va亚洲va久久|