NND的。刚才打得那么幸苦。超过8W字居然给我不能发布。还清空了。。这。。。
简直就吐血了
算了下。一共1174行代码
效果图;
好吧。。继续。。。
程序已经打包见附件
为了方便一些人。我特地用2010- -重新生成了静态库的EXE文件,
见附件
===================
头文件
=================
Blacksmith.h 铁匠铺
Character.h 角色属性
Enemy.h 敌人属性
Fighting.h 战斗控制
Select.h 主选择界面
Wait.h 大脚丫动画
========================================
- //Blacksmith.h
- #ifndef ONE3
- #include <iostream>
- #include <windows.h>
- #include"Select.h"
- using namespace std;
- class Blacksmith
- {
- public:
- static void display();
- friend void Select::display();//主选择界面
- private:
- };
- #define ONE3
- #endif ;
- //Character.h
- #ifndef ONE
- #include <iostream>
- #include <windows.h>
- #include"Enemy.h"
- #include"Blacksmith.h"
- using namespace std;
- class Character
- {
- public:
- static void display(string);
- static void show();
- static void view_properties();//查看属性
- friend static void Enemy::set(string);//设置敌人属性
- friend void Fighting::display(string);//战斗界面
- friend void Fighting::hurt(string p1);//伤害计算
- friend void Blacksmith::display();//武器强化界面
- friend void Select::display();//主选择界面
- private:
- /*=========常类=============*/
- static int money;//钱
- static string name;//名字
- static int exp_max;//经验上限
- static int exp_min;//经验下限
- static int lv;//等级
- /*=========属性类=============*/
- static int life_max;// 生命上限
- static int life_min;// 下限
- static int magic_max;// 魔力上限
- static int magic_min;// 下限
- static double b_attack;// 基本***力
- static double attack;// ***力=基本***力+武器***+武器属性前缀提升
- static double b_defense;// 基本防御力
- static double defense;// 防御=基本防御+衣服防御
- /*=======装备类==============*/
- static string b_weapons_name; //身上武器名字
- static int b_weapons;//身上武器属性
- static string b_prefix_name;//身上武器前缀名字
- static int b_prefix;//身上武器前缀属性
- static string b_clothes_name; //身上衣服名字
- static int b_clothes; //身上衣服属性
- /*=========库类===========*/
- static string weapons_name[5];//武器名字
- static int weapons[5];// 武器属性
- static string clothes_name;//衣服名字
- static int clothes;// 衣服属性
- static string prefix_name[4];// 属性前缀名字
- static int prefix[4];// 属性前缀
- };
- #define ONE
- #endif ;
- //Enemy.h
- #ifndef ONE1
- #include <iostream>
- #include<string>
- #include"Fighting.h"
- using namespace std;
- class Enemy
- {
- public:
- static void set(string);//设置敌人属性
- static void display(string );//输出敌人属性
- friend void Fighting::display(string);//战斗界面
- friend void Fighting::hurt(string );//伤害计算
- private:
- static string e_name;
- static int e_hp;
- static int e_att;
- static int e_def;
- //====BOSS=====
- static string boss_name;
- static int boss_hp;
- static int boss_att;
- static int boss_def;
- };
- #define ONE1
- #endif ;
- //Fighting.h
- #ifndef ONE2
- #include<iostream>
- #include<string>
- #include"Blacksmith.h"
- #include"Select.h"
- using namespace std;
- class Fighting
- {
- public:
- static void d_speed(int,string);//对话显示
- static int random(int a);//随机函数
- static void display(string);//进入战斗界面
- static void hurt(string);//伤害计算
- friend void Blacksmith::display();//武器强化界面
- friend void Select::display();//主选择界面
- private:
- static char role[3][50];//人物对话
- static char e_role[3][50];//怪物对话
- static char b_role[3][50];//BOSS对话
- static string mode;//战斗模式
- };
- #define ONE2
- #endif ;
- //Select.h
- #ifndef ONE4
- #include<iostream>
- //#include"Fighting.h"
- using namespace std;
- class Select //选择界面
- {
- public:
- static void display();
- //friend void Fighting::display(string p);
- };
- #define ONE4
- #endif ;
- //Wait.h
- #include <iostream>
- #include <windows.h>
- #include"Fighting.h"
- #include"Blacksmith.h"
- using namespace std;
- class Wait
- {
- public:
- static void display(int time);
- friend void Fighting::display(string p);
- friend void Blacksmith::display();//武器强化界面
- private:
- };
转载于:https://blog.51cto.com/flzt5354/515379