Skip to content

Commit

Permalink
Newest Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Realself-Ma committed Jun 24, 2020
1 parent db2d185 commit dedc8e3
Show file tree
Hide file tree
Showing 1,128 changed files with 30,783 additions and 750 deletions.
1,921 changes: 1,465 additions & 456 deletions Dungeon.cpp

Large diffs are not rendered by default.

96 changes: 79 additions & 17 deletions Dungeon.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,21 @@
#include <QMediaPlaylist>
#include <QKeyEvent>
#include <QString>
#include <QVector>
#include <QStack>
#include <QQueue>
#include "interface.h"
#include "factory.h"
#include "storewidget.h"
#include "sound.h"
#include "menu.h"
#include "help.h"
#include "sign.h"
extern QMainWindow *ptr_MianWindow;
extern interface* surface;
extern QGridLayout*gLayout_Map;
extern QWidget *MazeWidget[60][60];
extern QWidget *MazeWidget[12][16];
extern QWidget *People;
extern bool isShow;
struct character
{
QString name;
Expand All @@ -24,9 +29,8 @@ struct character
int atk;
int def;
int scoreNum;
int yellowkey;
int purplekey;
int redkey;
int Pickaxe;
int Downstairs;
};
struct Monster
{
Expand All @@ -49,32 +53,60 @@ class Dungeon: public QWidget
void keyPressEvent(QKeyEvent *event);
private:
void initialMap();
void initialpkMap();
void initialCharacterPos();
int pk(Monster &m);
int calc_damage(int MonsterNum);
void initialFogWidget();
void initialinfoWidget();//初始化状态界面
void setCharacterPos(int floor,int target);
void initialMapString();
void initialMonsterPic();//初始化怪物图片(用于战斗界面)
void initialrole();
void initialenemy();
void initialFogArr();
void ShowDungeon();//显示地牢
void ShowFog();//显示战争迷雾
void hideFog();
void hideDungeon();
void initialSetNameWin();
void initialGetitemWin();//初始化获得物品信息界面
void initialFightWin();//初始化战斗界面
void updateStatusData();//更新状态数据
bool isDynamic(int i,int j);
bool isDynamic(int floor,int i,int j);
bool isStatic(int num);
void Move();//人物移动
void Operation(int num);//移动操作
void changeHP(int num);
void changeMP(int num);
void QuestionBox(int num);//问号箱
void items(int _itemNum, int _moveDirection);//物品
void doors(int _doorNum, int _moveDirection);
void Monsters(int _MonsterNum,int _moveDirection);
void checkPrefloor();//上一层
void checkNextfloor();//下一层
private:
void RandomGeneraterMap(int arr[12][16], int floor);
void GenerateElement(int arr[12][16],int floor);
void GenerateMonster(int arr[12][16],int floor);
void GenerateItem(int arr[12][16],int floor);
void GenerateEquip();
bool isValid(int arr[12][16],int i,int j,int floor);
int sum(int arr[],int n);
void doDfs(int arr[12][16],QStack<std::pair<int,int>>& s,bool visited[12][16]);
void setExit(int arr[12][16], std::pair<int, int> &start, std::pair<int, int> &end);
void dfs(int arr[12][16], bool visited[12][16], QStack<std::pair<int, int> > &s, int i, int j);
void bfs(int arr[12][16], QStack<std::pair<int,int>> &s,std::pair<int, int> start, std::pair<int, int> end);
private:
void breakWall(int _moveDirection);
void DownstairsRun();
void deadCall();
void GameOverCall();
void addFogArea(int floor, int i, int j, int num);
void updateFogArea(int floor,int i, int j);
void pkMapFightWinShow();
void ReturnDungeon();
void pkOverCall(int MyPoint,int CmptorPoint);
void stopAllwork();
private://获得物品信息栏
QLabel *GetitemsShow;
QTimer *GetitemTimer;
Expand All @@ -85,7 +117,6 @@ class Dungeon: public QWidget
QPushButton *SetDone;
private://战斗界面
QWidget *FightWidget;
QTimer *FightTimer;
bool isFighting;
QLabel *Monster_pic;//怪物信息标签
QLabel *Monster_name;
Expand All @@ -104,13 +135,25 @@ class Dungeon: public QWidget
QLabel *Character_atk;
QLabel *Character_defText;
QLabel *Character_def;

QLabel *NetMode_time;
QLabel *NetMode_secondes;
QLabel* label_MyName;
QLabel* label_VS;
QLabel* label_CmptorName;
QLabel* label_MyPonit;
QLabel* label_split;
QLabel* label_CmptorPoint;
QTimer *NetModeCountDownTimer;
QWidget* competitor;
int CountDown;
int MyPonit;
int CmptorPoint;
bool NetModeStart;
bool MyWin;
bool dogFall;
int MonsterNum;//怪物编号
int fight_period_it;//战斗次数
int fight_end_it;//战斗结束标识
private://按钮
QPushButton *ReturnMainMenu;
QPushButton *Restart;
private://动态效果
QTimer *dynamicEffectTimer;//动态效果计时器
int display_it;
Expand All @@ -124,20 +167,37 @@ private slots:

void ReturnMainMenuPlay();//返回主菜单
void RestartPlay();//重新开始
void ContinuePlay();//继续游戏
void ReturnRoomsPlay();//返回游戏房间
void HelpPlay();//帮助界面
void HelpReturnPlay();//帮助界面返回
void EnterDungeon();//角色名设置完成,进入地牢
void NetStart();
void pkStart();
void NetModeCountDownRun();
void pkMapUpdate();
void competitorGameOverCall();
private:
character role;
Monster enemy[10];
QString DungeonStytle[41][4];
QString MonsterPic[20];//怪物图片字符串
int floor;
int Total_Floor;
int ***map;//三维数组
int x;//角色位置
int y;
int pre_x;
int pre_y;
int pre_floor;
int MAX_HP;
int MAX_MP;
int deadTimes;
bool isPre;
bool isNext;
bool PickaxeUse;
bool isDead;
QWidget *FogWidget[12][16];//战争迷雾窗口数组
int FogArr[8][12][16];
int haveVisited[8][12][16];
private:
int moveDirection;//移动方向
int moveNum;
Expand All @@ -150,12 +210,14 @@ private slots:
QLabel *atk;
QLabel *def;
QLabel *score;//金币
QLabel *yellowkeyNum;//钥匙信息
QLabel *purplekeyNum;
QLabel *redkeyNum;
QLabel *PickaxeNum;//钥匙信息
QLabel *DownstairsNum;
//QLabel *redkeyNum;
QLabel *CharacterName;
private:
StoreWidget *Store;
Menu* menu;
Help* help;
Factory* fac;
};

Expand Down
File renamed without changes.
45 changes: 45 additions & 0 deletions MarioDungeon.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#-------------------------------------------------
#
# Project created by QtCreator 2020-05-22T09:26:04
#
#-------------------------------------------------

QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = MarioDungeon
TEMPLATE = app


SOURCES += main.cpp \
Dungeon.cpp \
storewidget.cpp \
factory.cpp \
sound.cpp \
interface.cpp \
mainwindow.cpp \
menu.cpp \
sign.cpp \
rooms.cpp \
chatroom.cpp \
help.cpp

HEADERS += \
Dungeon.h \
storewidget.h \
factory.h \
sound.h \
interface.h \
mainwindow.h \
menu.h \
sign.h \
request.h \
rooms.h \
chatroom.h \
help.h
QT += multimedia
RC_ICONS = MarioDungeon.ico

RESOURCES += \
sources.qrc
Loading

0 comments on commit dedc8e3

Please sign in to comment.