diff --git a/project/data.js b/project/data.js index fd3673a..242d8a1 100644 --- a/project/data.js +++ b/project/data.js @@ -1120,8 +1120,8 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "hp": 1000, "manamax": -1, "mana": 0, - "atk": 100, - "def": 100, + "atk": 60, + "def": 10, "mdef": 100, "speed": 10, "money": 0, diff --git a/project/enemys.js b/project/enemys.js index d1ff382..0bf94a9 100644 --- a/project/enemys.js +++ b/project/enemys.js @@ -4,7 +4,7 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 = "redSlime": {"name":"红头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[],"value":10}, "blackSlime": {"name":"青头怪","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, "slimelord": {"name":"怪王","hp":100,"atk":120,"def":0,"money":10,"exp":0,"point":0,"special":[1,9]}, - "bat": {"name":"小蝙蝠","hp":100,"atk":120,"def":0,"money":2,"exp":0,"point":0,"special":[1],"mdef":0,"speed":15}, + "bat": {"name":"小蝙蝠","hp":100,"atk":50,"def":30,"money":2,"exp":0,"point":0,"special":[1],"mdef":0,"speed":15}, "bigBat": {"name":"大蝙蝠","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":0}, "redBat": {"name":"红蝙蝠","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]}, "vampire": {"name":"冥灵魔王","hp":888,"atk":888,"def":888,"money":888,"exp":888,"point":0,"special":[6],"n":8}, diff --git a/project/plugins.js b/project/plugins.js index 9efcc03..cb54c29 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -4623,6 +4623,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = 100, 200, // 位置 (x, y) -50, // 伤害值 24, // 字体大小 + "宋体",//字体 '#FF0000', // 字体颜色 '#000000', // 描边颜色 0.5, // 水平速度 (speedX) @@ -4652,9 +4653,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = }; // 弹出伤害气泡 - Dove.MorePerform.ShowDamagePop.PopDamage = function (canvasName, x, y, damageValue, fontSize, fontColor, outlineColor, speedX, speedY, gravity, duration) { + Dove.MorePerform.ShowDamagePop.PopDamage = function (canvasName, x, y, damageValue, fontSize, font, fontColor, outlineColor, speedX, speedY, gravity, duration) { if (damageValue) { - var poper = new PopSprite(canvasName, x, y, damageValue, fontSize, fontColor, outlineColor, speedX, speedY, gravity, duration); + var poper = new PopSprite(canvasName, x, y, damageValue, fontSize, font, fontColor, outlineColor, speedX, speedY, gravity, duration); Dove.MorePerform.ShowDamagePop.AllPopingCanvas.push(poper); } }; @@ -4675,7 +4676,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = null, // 默认水平速度 null, // 默认垂直速度 null, // 默认重力 - 180 // 默认显示时长(帧数) + 90 // 默认显示时长(帧数) ); }; let time = 0 @@ -4692,7 +4693,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = ); // 弹出精灵类 - function PopSprite(canvasName, x, y, damage, fontSize, fontColor, outlineColor, speedX, speedY, gravity, duration) { + function PopSprite(canvasName, x, y, damage, fontSize, font, fontColor, outlineColor, speedX, speedY, gravity, duration) { this.initialize.apply(this, arguments); } @@ -4705,12 +4706,13 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = PopSprite._floorDis = 20; // 初始化 - PopSprite.prototype.initialize = function (canvasName, x, y, damage, fontSize, fontColor, outlineColor, speedX, speedY, gravity, duration) { + PopSprite.prototype.initialize = function (canvasName, x, y, damage, fontSize, font, fontColor, outlineColor, speedX, speedY, gravity, duration) { this._canvasName = canvasName ?? 'ui'; // 默认画布名称 this._x = x; this._y = y; this._damage = damage; this._fontSize = fontSize ?? 16; // 默认字体大小 + this._font = font ?? "宋体" this._fontColor = fontColor ?? (damage > 0 ? '#22FF44' : '#FF2244'); // 默认颜色 this._outlineColor = outlineColor ?? '#000000'; // 默认描边颜色 this._speedX = speedX ?? (-2 + Math.random() * 3); // 水平速度,默认随机 @@ -4743,7 +4745,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = PopSprite.prototype.requestCanvas = function () { core.createCanvas(this._symbol, this._x, this._y, this._width, this._height, this._z); var canvas = core.ui.getContextByName(this._symbol); - canvas.font = this._fontSize + 'px pala'; // 动态设置字体大小 + canvas.font = this._fontSize + 'px ' + this._font; // 动态设置字体大小 canvas.fillStyle = this._fontColor; // 动态设置字体颜色 canvas.strokeStyle = this._outlineColor; // 动态设置描边颜色 canvas.strokeText(this._text, 2, this._height); @@ -4754,11 +4756,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = PopSprite.prototype.initAllMembers = function () { this._text = String(this._damage); var uiContext = core.ui.getContextByName(this._canvasName); // 使用指定画布 - uiContext.font = this._fontSize + 'px pala'; // 动态设置字体大小 + uiContext.font = this._fontSize + 'px 宋体'; // 动态设置字体大小 var textRect = uiContext.measureText(this._text); this._width = Math.round(textRect.width + 4); this._height = this._fontSize + 4; // 动态设置高度 - this._z = PopSprite._baseZOrder + PopSprite._count; + this._z = uiContext.canvas.style.zIndex ? uiContext.canvas.style.zIndex + PopSprite._count : PopSprite._baseZOrder + PopSprite._count; this._symbol = 'popSprite' + PopSprite._count++; this._alive = true; this._vx = this._speedX; // 使用传入的水平速度 @@ -21083,8 +21085,47 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } }); if (!attack && nowattacking) { - if (heroInfo.isAttack) animateOnAttack('sword', true) - if (enemyInfo.isAttack) animateOnAttack('sword', false) + + if (heroInfo.isAttack) { + const herodamage = -Math.max(heroInfo.atk - enemyInfo.def, 0) + Dove.MorePerform.ShowDamagePop.PopDamage( + ctx, // 默认画布名称 + 270, // 英雄位置 x + 140, // 英雄位置 y + herodamage, // 伤害值 + 16, // 默认字体大小 + null, //默认字体 + null, // 默认颜色 + null, // 默认描边颜色 + 0, // 默认水平速度 + -1, // 默认垂直速度 + 0, // 默认重力 + 90 // 默认显示时长(帧数) + ); + enemyInfo.hp += herodamage + if (enemyInfo.hp < 0) enemyInfo.hp = 0 + animateOnAttack('sword', true) + } + if (enemyInfo.isAttack) { + const enemydamage = -Math.max(enemyInfo.atk - heroInfo.def, 0) + Dove.MorePerform.ShowDamagePop.PopDamage( + ctx, // 默认画布名称 + 115, // 英雄位置 x + 140, // 英雄位置 y + enemydamage, // 伤害值 + 16, // 默认字体大小 + null, //默认字体 + null, // 默认颜色 + null, // 默认描边颜色 + 0, // 默认水平速度 + -1, // 默认垂直速度 + 0, // 默认重力 + 90 // 默认显示时长(帧数) + ); + heroInfo.hp += enemydamage + if (heroInfo.hp < 0) heroInfo.hp = 0 + animateOnAttack('sword', false) + } if (equipanimate.length > 0) { equipanimate.forEach(v => { animateOnAttack('sword', true) @@ -21127,12 +21168,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } } + } - - }; - function animateOnAttack(name, onenemy) { if (onenemy) { playanimate(name, 290, 160); @@ -21147,7 +21186,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = damageInfo, equipInfo = [] ) { - //参数分别为怪物真实属性,战斗信息,特殊装备(如火焰风衣)属性特殊装备属性为以元组{equipId,oneDamage,speed,now:0}构成的数组(列出每个需要计算的特殊装备,没有则为空数组或不填) + //参数分别为怪物id、真实属性,战斗信息,特殊装备(如火焰风衣)属性特殊装备属性为以元组{equipId,oneDamage,speed,now:0}构成的数组(列出每个需要计算的特殊装备,没有则为空数组或不填) core.lockControl(); core.clearMap(ctx); core.status.event.id = "attackAnimate"; @@ -21205,10 +21244,13 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = damageInfo, onegcd ); + + farme++; } }); - }; + + } }, "剧情内容": function () { // 在此增加新插件