Add Point'
This commit is contained in:
parent
356dc647b4
commit
0c61b6d28d
38
libs/core.js
38
libs/core.js
@ -1700,6 +1700,27 @@ core.prototype.changeFloor = function (floorId, stair, heroLoc, time, callback)
|
|||||||
core.statusBar.floor.style.fontStyle = 'italic';
|
core.statusBar.floor.style.fontStyle = 'italic';
|
||||||
else core.statusBar.floor.style.fontStyle = 'normal';
|
else core.statusBar.floor.style.fontStyle = 'normal';
|
||||||
|
|
||||||
|
// 不存在事件时,更改画面色调
|
||||||
|
if (core.status.event.id == null) {
|
||||||
|
// 默认画面色调
|
||||||
|
if (core.isset(core.floors[floorId].color)) {
|
||||||
|
var color = core.floors[floorId].color;
|
||||||
|
|
||||||
|
// 直接变色
|
||||||
|
var nowR = parseInt(color[0]), nowG = parseInt(color[1]), nowB = parseInt(color[2]);
|
||||||
|
var toRGB = "#"+((1<<24)+(nowR<<16)+(nowG<<8)+nowB).toString(16).slice(1);
|
||||||
|
core.dom.curtain.style.background = toRGB;
|
||||||
|
if (core.isset(color[3]))
|
||||||
|
core.dom.curtain.style.opacity = color[3];
|
||||||
|
else core.dom.curtain.style.opacity=1;
|
||||||
|
core.status.curtainColor = color;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
core.dom.curtain.style.background = "#000000";
|
||||||
|
core.dom.curtain.style.opacity = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
core.drawMap(floorId, function () {
|
core.drawMap(floorId, function () {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
core.mapChangeAnimate('hide', time/4, function () {
|
core.mapChangeAnimate('hide', time/4, function () {
|
||||||
@ -1904,7 +1925,7 @@ core.prototype.drawAutotile = function (floorId, canvas, autotileMaps, left, top
|
|||||||
}
|
}
|
||||||
|
|
||||||
var isAutotile = function(x, y) {
|
var isAutotile = function(x, y) {
|
||||||
if (x<0 || x>12 || y<0 || y>12) return 0;
|
if (x<0 || x>12 || y<0 || y>12) return 1;
|
||||||
return autotileMaps[13*x+y]==autotileId?1:0;
|
return autotileMaps[13*x+y]==autotileId?1:0;
|
||||||
}
|
}
|
||||||
for (var xx=0;xx<13;xx++) {
|
for (var xx=0;xx<13;xx++) {
|
||||||
@ -2634,7 +2655,8 @@ core.prototype.snipe = function (snipes) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
core.prototype.setFg = function(color, time, callback) {
|
core.prototype.setFg = function(color, time, callback) {
|
||||||
time = time || 750;
|
if (!core.isset(time)) time=750;
|
||||||
|
if (time<=0) time=0;
|
||||||
|
|
||||||
if (!core.isset(core.status.curtainColor)) {
|
if (!core.isset(core.status.curtainColor)) {
|
||||||
core.status.curtainColor = [0,0,0,0];
|
core.status.curtainColor = [0,0,0,0];
|
||||||
@ -2649,6 +2671,18 @@ core.prototype.setFg = function(color, time, callback) {
|
|||||||
if (color[3]<0) color[3]=0;
|
if (color[3]<0) color[3]=0;
|
||||||
if (color[3]>1) color[3]=1;
|
if (color[3]>1) color[3]=1;
|
||||||
|
|
||||||
|
|
||||||
|
if (time==0) {
|
||||||
|
// 直接变色
|
||||||
|
var nowR = parseInt(color[0]), nowG = parseInt(color[1]), nowB = parseInt(color[2]);
|
||||||
|
var toRGB = "#"+((1<<24)+(nowR<<16)+(nowG<<8)+nowB).toString(16).slice(1);
|
||||||
|
core.dom.curtain.style.background = toRGB;
|
||||||
|
core.dom.curtain.style.opacity = color[3];
|
||||||
|
core.status.curtainColor = color;
|
||||||
|
if (core.isset(callback)) callback();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var step=0;
|
var step=0;
|
||||||
var changeAnimate = setInterval(function() {
|
var changeAnimate = setInterval(function() {
|
||||||
step++;
|
step++;
|
||||||
|
|||||||
@ -5,7 +5,7 @@ function enemys() {
|
|||||||
enemys.prototype.init = function () {
|
enemys.prototype.init = function () {
|
||||||
// 怪物属性初始化定义:
|
// 怪物属性初始化定义:
|
||||||
this.enemys = {
|
this.enemys = {
|
||||||
'greenSlime': {'name': '绿头怪', 'hp': 100, 'atk': 120, 'def': 0, 'money': 1, 'experience': 1, 'special': 0},
|
'greenSlime': {'name': '绿头怪', 'hp': 100, 'atk': 120, 'def': 0, 'money': 1, 'experience': 1, 'special': 0, 'point': 2},
|
||||||
'redSlime': {'name': '红头怪', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0},
|
'redSlime': {'name': '红头怪', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0},
|
||||||
'blackSlime': {'name': '青头怪', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0},
|
'blackSlime': {'name': '青头怪', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0},
|
||||||
'slimelord': {'name': '怪王', 'hp': 100, 'atk': 120, 'def': 0, 'money': 10, 'experience': 0, 'special': 9},
|
'slimelord': {'name': '怪王', 'hp': 100, 'atk': 120, 'def': 0, 'money': 10, 'experience': 0, 'special': 9},
|
||||||
@ -106,6 +106,34 @@ enemys.prototype.getSpecialText = function (enemyId) {
|
|||||||
return text.join(" ");
|
return text.join(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////// 获得每个属性的文字提示 //////
|
||||||
|
enemys.prototype.getSpecialHint = function (enemy, special) {
|
||||||
|
switch (special) {
|
||||||
|
case 1: return "怪物首先攻击";
|
||||||
|
case 2: return "怪物无视勇士的魔防";
|
||||||
|
case 3: return "勇士每回合最多只能对怪物造成1点伤害";
|
||||||
|
case 4: return "怪物每回合攻击2次";
|
||||||
|
case 5: return "怪物每回合攻击3次";
|
||||||
|
case 6: return "怪物每回合攻击4次";
|
||||||
|
case 7: return "战斗前,怪物附加角色防御的"+parseInt(100*core.values.breakArmor)+"%作为伤害";
|
||||||
|
case 8: return "战斗时,怪物每回合附加角色攻击的"+parseInt(100*core.values.counterAttack)+"%作为伤害,无视角色防御";
|
||||||
|
case 9: return "战斗前,怪物附加勇士魔防的"+core.values.purify+"倍作为伤害";
|
||||||
|
case 10: return "怪物的攻防和勇士攻防相等";
|
||||||
|
case 11: return "战斗前,怪物首先吸取角色的"+parseInt(100*enemy.value)+"%生命作为伤害";
|
||||||
|
case 12: return "战斗后,勇士陷入中毒状态,每一步损失生命"+core.values.poisonDamage+"点";
|
||||||
|
case 13: return "战斗后,勇士陷入衰弱状态,攻防暂时下降"+core.values.weakValue+"点";
|
||||||
|
case 14: return "战斗后,勇士陷入诅咒状态,战斗无法获得金币和经验";
|
||||||
|
case 15: return "经过怪物周围"+(enemy.range||1)+"格时自动减生命"+enemy.damage+"点";
|
||||||
|
case 16: return "经过两只相同的怪物中间,勇士生命值变成一半";
|
||||||
|
case 17: return "战斗前,怪物附加之前积累的仇恨值作为伤害;战斗后,释放一半的仇恨值。(每杀死一个怪物获得"+core.values.hatred+"点仇恨值)";
|
||||||
|
case 18: return "经过怪物的十字领域时自动减生命"+enemy.value+"点,同时怪物后退一格";
|
||||||
|
case 19: return "战斗后勇士的生命值变成1";
|
||||||
|
case 20: return "勇士无法打败怪物,除非拥有十字架";
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
enemys.prototype.getDamage = function (monsterId) {
|
enemys.prototype.getDamage = function (monsterId) {
|
||||||
var monster = core.material.enemys[monsterId];
|
var monster = core.material.enemys[monsterId];
|
||||||
var hero_atk = core.status.hero.atk, hero_def = core.status.hero.def, hero_mdef = core.status.hero.mdef;
|
var hero_atk = core.status.hero.atk, hero_def = core.status.hero.def, hero_mdef = core.status.hero.mdef;
|
||||||
|
|||||||
@ -410,7 +410,12 @@ events.prototype.doAction = function() {
|
|||||||
|
|
||||||
////// 往当前事件列表之前添加一个或多个事件 //////
|
////// 往当前事件列表之前添加一个或多个事件 //////
|
||||||
events.prototype.insertAction = function (action) {
|
events.prototype.insertAction = function (action) {
|
||||||
core.unshift(core.status.event.data.list, action)
|
if (core.status.event.id == null) {
|
||||||
|
this.doEvents(action);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
core.unshift(core.status.event.data.list, action)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 打开商店 //////
|
////// 打开商店 //////
|
||||||
@ -517,6 +522,30 @@ events.prototype.useItem = function(itemId) {
|
|||||||
else core.drawTip("当前无法使用"+core.material.items[itemId].name);
|
else core.drawTip("当前无法使用"+core.material.items[itemId].name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////// 加点 //////
|
||||||
|
events.prototype.addPoint = function (enemy) {
|
||||||
|
var point = enemy.point;
|
||||||
|
if (!core.isset(point) || point<=0) return [];
|
||||||
|
|
||||||
|
// 加点,返回一个choices事件
|
||||||
|
return [
|
||||||
|
{"type": "choices",
|
||||||
|
"choices": [
|
||||||
|
{"text": "生命+"+(200*point), "action": [
|
||||||
|
{"type": "setValue", "name": "status:hp", "value": "status:hp+"+(200*point)}
|
||||||
|
]},
|
||||||
|
{"text": "攻击+"+(1*point), "action": [
|
||||||
|
{"type": "setValue", "name": "status:atk", "value": "status:atk+"+(1*point)}
|
||||||
|
]},
|
||||||
|
{"text": "防御+"+(2*point), "action": [
|
||||||
|
{"type": "setValue", "name": "status:def", "value": "status:def+"+(2*point)}
|
||||||
|
]},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/****** 打完怪物 ******/
|
/****** 打完怪物 ******/
|
||||||
events.prototype.afterBattle = function(enemyId,x,y,callback) {
|
events.prototype.afterBattle = function(enemyId,x,y,callback) {
|
||||||
|
|
||||||
@ -548,49 +577,55 @@ events.prototype.afterBattle = function(enemyId,x,y,callback) {
|
|||||||
core.setFlag('hatred', core.getFlag('hatred',0)+core.values.hatred);
|
core.setFlag('hatred', core.getFlag('hatred',0)+core.values.hatred);
|
||||||
core.updateStatusBar();
|
core.updateStatusBar();
|
||||||
|
|
||||||
|
|
||||||
|
// 事件的处理
|
||||||
|
var todo = [];
|
||||||
|
// 如果不为阻击,且该点存在,且有事件
|
||||||
|
if (!core.enemys.hasSpecial(special, 18) && core.isset(x) && core.isset(y)) {
|
||||||
|
var event = core.floors[core.status.floorId].afterBattle[x+","+y];
|
||||||
|
if (core.isset(event)) {
|
||||||
|
// 插入事件
|
||||||
|
core.unshift(todo, event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 如果有加点
|
||||||
|
var point = core.material.enemys[enemyId].point;
|
||||||
|
if (core.isset(point) && point>0) {
|
||||||
|
core.unshift(todo, core.events.addPoint(core.material.enemys[enemyId]));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果事件不为空,将其插入
|
||||||
|
if (todo.length>0) {
|
||||||
|
this.insertAction(todo);
|
||||||
|
}
|
||||||
|
|
||||||
// 如果已有事件正在处理中
|
// 如果已有事件正在处理中
|
||||||
if (core.status.lockControl) {
|
if (core.status.event.id == null) {
|
||||||
if (core.isset(callback)) callback();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 阻击:不处理任何事件
|
|
||||||
if (core.enemys.hasSpecial(special, 18)) {
|
|
||||||
if (core.isset(callback)) callback();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 检查处理后的事件。
|
|
||||||
var event = core.floors[core.status.floorId].afterBattle[x+","+y];
|
|
||||||
if (core.isset(event)) {
|
|
||||||
core.events.doEvents(event, x, y, callback);
|
|
||||||
}
|
|
||||||
//继续行走
|
|
||||||
else {
|
|
||||||
core.continueAutomaticRoute();
|
core.continueAutomaticRoute();
|
||||||
}
|
}
|
||||||
if (core.isset(callback)) callback();
|
if (core.isset(callback)) callback();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****** 开完门 ******/
|
/****** 开完门 ******/
|
||||||
events.prototype.afterOpenDoor = function(doorId,x,y,callback) {
|
events.prototype.afterOpenDoor = function(doorId,x,y,callback) {
|
||||||
|
|
||||||
// 如果已有事件正在处理中
|
var todo = [];
|
||||||
if (core.status.lockControl) {
|
if (core.isset(x) && core.isset(y)) {
|
||||||
if (core.isset(callback)) callback();
|
var event = core.floors[core.status.floorId].afterOpenDoor[x+","+y];
|
||||||
return;
|
if (core.isset(event)) {
|
||||||
|
core.unshift(todo, event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查处理后的事件。
|
if (todo.length>0) {
|
||||||
var event = core.floors[core.status.floorId].afterOpenDoor[x+","+y];
|
this.insertAction(todo);
|
||||||
if (core.isset(event)) {
|
|
||||||
core.events.doEvents(event, x, y, callback);
|
|
||||||
}
|
}
|
||||||
//继续行走
|
|
||||||
else {
|
if (core.status.event.id == null) {
|
||||||
core.continueAutomaticRoute();
|
core.continueAutomaticRoute();
|
||||||
if (core.isset(callback)) callback();
|
|
||||||
}
|
}
|
||||||
|
if (core.isset(callback)) callback();
|
||||||
}
|
}
|
||||||
|
|
||||||
/****** 经过路障 ******/
|
/****** 经过路障 ******/
|
||||||
|
|||||||
@ -8,6 +8,7 @@ main.floors.sample2 = {
|
|||||||
"canFlyTo": false, // 该楼能否被楼传器飞到(不能的话在该楼也不允许使用楼传器)
|
"canFlyTo": false, // 该楼能否被楼传器飞到(不能的话在该楼也不允许使用楼传器)
|
||||||
"canUseQuickShop": true, // 该层是否允许使用快捷商店
|
"canUseQuickShop": true, // 该层是否允许使用快捷商店
|
||||||
"defaultGround": "snowGround", // 默认地面的图块ID(terrains中)
|
"defaultGround": "snowGround", // 默认地面的图块ID(terrains中)
|
||||||
|
"color": [255,0,0,0.3], // 可以设置该层的默认背景色调(RGBA);本项可省略
|
||||||
"map": [ // 地图数据,需要是13x13,建议使用地图生成器来生成
|
"map": [ // 地图数据,需要是13x13,建议使用地图生成器来生成
|
||||||
[5, 5, 5, 5, 5, 5, 87, 5, 5, 5, 5, 5, 5],
|
[5, 5, 5, 5, 5, 5, 87, 5, 5, 5, 5, 5, 5],
|
||||||
[5, 4, 4, 4, 4, 1, 0, 1, 4, 4, 4, 4, 5],
|
[5, 4, 4, 4, 4, 1, 0, 1, 4, 4, 4, 4, 5],
|
||||||
|
|||||||
4
更新说明.txt
4
更新说明.txt
@ -1,6 +1,6 @@
|
|||||||
全键盘操作 √
|
全键盘操作 √
|
||||||
经验升级(进阶) √
|
经验升级(进阶) √
|
||||||
增加阻击、自爆、无敌属性 √
|
增加阻击等属性;属性显示;加点; √
|
||||||
九宫格领域、大范围领域 √
|
九宫格领域、大范围领域 √
|
||||||
Ctrl快速跳过对话 √
|
Ctrl快速跳过对话 √
|
||||||
增加负伤 √
|
增加负伤 √
|
||||||
@ -9,4 +9,4 @@ Ctrl快速跳过对话 √
|
|||||||
支持多个Autotile同时存在 √
|
支持多个Autotile同时存在 √
|
||||||
直接内嵌了诸多默认的terrains素材 √
|
直接内嵌了诸多默认的terrains素材 √
|
||||||
自动定位到上次存/读档位置 √
|
自动定位到上次存/读档位置 √
|
||||||
修改setFg的实现方法 √
|
每一层可以默认色调 √
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user