Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

Commit

Permalink
allow customize game
Browse files Browse the repository at this point in the history
  • Loading branch information
byn9826 committed Nov 4, 2017
1 parent d223a65 commit 0494261
Show file tree
Hide file tree
Showing 20 changed files with 1,385 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules
package-lock.json
docs/save/*json
9 changes: 5 additions & 4 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

3. 自定义剧本
可以直接覆盖城市,国家,英雄,精兵的名称及部分数据来完全更改游戏的历史背景
参考/docs/scenario/三国鼎立.json文件,将想要覆盖的内容放到"rewrite"中
![Modified theme](https://raw.githubusercontent.com/byn9826/Warring-States-Epic/master/~legend/7.jpg)

主要选项
--
Expand All @@ -56,15 +58,15 @@ Vue的主文件/docs/source/epic.js会监听设置并调整对应参数

游戏规则
--
基本上是根据权力的游戏版图桌游改编的,AI比较难写的地方都被改了...
基本上是根据权力的游戏版图桌游改编的,AI比较难写的地方都改编了...
![map](https://raw.githubusercontent.com/byn9826/Warring-States-Epic/master/~legend/3.jpg)

整个流程靠round, stage, active的一个循环来控制, 主要通过
整个流程靠round, stage, active三个变量的大循环来控制, 主要在
/docs/source/epic.js
/docs/component/decision-board.js
/docs/processor/before-battle.js
/docs/processor/after-battle.js
相互触发
四个文件中相互触发

游戏每回合分为七个阶段

Expand Down Expand Up @@ -133,7 +135,6 @@ AI
--
各个阶段AI均会做出相应的行动,由/docs/source/ai下的文件决定
AI目前比较简单,基本为判断当前形势给出一个合理固定值外加一个随机数
以后可能会用来玩ML AI
```
/docs/source/ai/ally.js //发起同盟请求,接受或拒绝同盟请求
/docs/source/ai/breach.js //是否背弃同盟
Expand Down
1 change: 0 additions & 1 deletion docs/.gitignore

This file was deleted.

23 changes: 11 additions & 12 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
var dir = path.join(__dirname, './save/');
var save = [];
fs.readdirSync(dir).forEach(function(file) {
save.push({
name: file,
time: new Date(fs.statSync(dir + file).mtime).getTime()
})
if (file.substr(-5) === ".json") {
save.push({
name: file,
time: new Date(fs.statSync(dir + file).mtime).getTime()
});
}
});
save.sort(function(a, b) {
return a.time < b.time;
Expand All @@ -32,9 +34,6 @@
content = JSON.parse(fs.readFileSync(scenerios + file, {encoding:'utf-8'}));
scenerio.push(content);
});
// var loc = path.join(__dirname, './scenario/default.json');
// var file = fs.readFileSync(loc, {encoding:'utf-8'});
// data = JSON.parse(file);
} catch(e) {}
data = {
"settings": {
Expand Down Expand Up @@ -204,7 +203,7 @@ <h4 v-bind:title="getEventDesc(situation)">{{getEventSituation(situation)}}</h4>
<h4 v-bind:title="'四夷入侵时,各国损失与四夷战力相等的国力.国库亏空时,损失加倍'">
四夷战力: {{wild}}
</h4>
<h5>战国七雄</h5>
<h5>势力</h5>
<template v-for="(s, index) in getStatesInfo()" v-if="player[index]!==0">
<state-info
v-bind:definition="s"
Expand Down Expand Up @@ -255,13 +254,13 @@ <h4 style="margin-top:5pt">游戏模式</h4>
<option style="padding:2pt 0; background-color: transparent" value="1"
title="您将控制一个国家并与电脑在十回合的较量中分出胜负"
>
十回称霸
十回争霸
</option>
<option
title="您将一直参照直至您退出游戏, 仅支持困难模式"
style="padding:2pt 0; background-color: transparent" value="2"
>
灭国统一
灭国称帝
</option>
</select>
<template v-if="settings.mode!==0">
Expand Down Expand Up @@ -349,7 +348,7 @@ <h3 style="display: block; color: lightgrey; margin-bottom: 5pt">
type="button" value="开始游戏" v-on:click="startGame" v-else
/>
</div>
<div style="display:block;width:800pt">
<div style="display:block;width:850pt">
<div class="start-state" v-for="(state, i) in getStatesInfo()"
v-if="player[i] !== 0" v-on:click="selectState(i)"
v-bind:style="{backgroundColor:player[i]===2?'white':'darkgrey'}"
Expand All @@ -366,7 +365,7 @@ <h4 style="display:block;margin-top:5pt">都城 {{getCitiesInfo()[getStatesBaseL
{{getArmyInfo()[i].name}} - 攻击{{getArmyInfo()[i].attack}} 防御{{getArmyInfo()[i].defend}}
</p>
</div>
<p style="display:block;font-size:9pt">
<p style="display:block;font-size:10pt">
{{getStatesInfo()[i].motto}}
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/public/general.css
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ h5{
margin-top: 10pt;
padding: 5pt;
border-radius: 3pt;
width: 150pt;
width: 170pt;
text-align: center;
cursor: pointer;
}
Expand Down
Empty file added docs/save/test
Empty file.
Loading

0 comments on commit 0494261

Please sign in to comment.