fix: font & calAttribute

This commit is contained in:
unanmed 2024-03-02 19:20:15 +08:00
parent dcf540ae40
commit 5bf261b4a5
6 changed files with 81 additions and 28 deletions

View File

@ -4,19 +4,24 @@
--pixel: 416px; --pixel: 416px;
} }
html, body, div, img { html,
body,
div,
img {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
html, body { html,
body {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
} }
body { body {
font-family: Roboto, "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;; font-family: Roboto, 'Helvetica Neue', Helvetica, 'PingFang SC',
'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
} }
/* ::-webkit-scrollbar { /* ::-webkit-scrollbar {
@ -29,7 +34,7 @@ body {
} }
.cp-app { .cp-app {
z-index: 250; z-index: 250;
} }
#colorPanel { #colorPanel {
@ -43,12 +48,15 @@ body {
} }
#colorPicker { #colorPicker {
margin: 2px 0; margin: 2px 0;
border-radius: 3px; border-radius: 3px;
width: 104px; width: 104px;
} }
#left, #mid, #mid2, #right { #left,
#mid,
#mid2,
#right {
border-radius: 2px; border-radius: 2px;
box-sizing: border-box; box-sizing: border-box;
} }
@ -171,7 +179,7 @@ body {
left: 0; left: 0;
bottom: 0; bottom: 0;
padding: 10px 5px; padding: 10px 5px;
margin-left: 8px;; margin-left: 8px;
box-sizing: border-box; box-sizing: border-box;
} }
@ -247,7 +255,8 @@ body {
position: absolute; position: absolute;
} }
#dataSelection, .appendSelection { #dataSelection,
.appendSelection {
position: absolute; position: absolute;
/* top:0; /* top:0;
left:320px; */ left:320px; */
@ -279,7 +288,8 @@ body {
line-height: 1.2em; line-height: 1.2em;
} }
#mapColMark, #mapRowMark { #mapColMark,
#mapRowMark {
cursor: crosshair; cursor: crosshair;
} }
@ -356,8 +366,11 @@ table.row {
z-index: 100; z-index: 100;
} }
#menuDiv * { margin: 0; padding: 0; } #menuDiv * {
#midMenu{ margin: 0;
padding: 0;
}
#midMenu {
border-style: solid; border-style: solid;
border-width: 1px; border-width: 1px;
cursor: default; cursor: default;
@ -373,7 +386,7 @@ table.row {
border-radius: 4px; border-radius: 4px;
} }
#midMenu .menuitem{ #midMenu .menuitem {
font: normal 13px Arial, sans-serif; font: normal 13px Arial, sans-serif;
list-style: none; list-style: none;
margin: 0; margin: 0;
@ -384,13 +397,13 @@ table.row {
/* padding-right: 20px; */ /* padding-right: 20px; */
} }
#midMenu .menuitem:hover{ #midMenu .menuitem:hover {
border-style: dotted; border-style: dotted;
border-width: 1px 0; border-width: 1px 0;
padding-bottom: 3px; padding-bottom: 3px;
padding-top: 3px; padding-top: 3px;
} }
#midMenu .menuitem-content{ #midMenu .menuitem-content {
font: normal 13px Arial, sans-serif; font: normal 13px Arial, sans-serif;
} }
@ -408,7 +421,7 @@ table.row {
position: absolute; position: absolute;
left: 6px; left: 6px;
top: 6px; top: 6px;
background-image:url('data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGJhc2VQcm9maWxlPSJmdWxsIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWxuczpldj0iaHR0cDovL3d3dy53My5vcmcvMjAwMS94bWwtZXZlbnRzIj4KPGc%2BCgk8cG9seWdvbiBmaWxsPSIjNjY2IiBwb2ludHM9IjkuMjA3LDYuMTI2IDcuNzkzLDcuNTQxIDExLjc5MywxMS41NDEgMTMuMjA3LDEwLjEyNiIgLz4KCTxwYXRoIGZpbGw9IiM2NjYiIGQ9Ik01LjkxNywyYzEuNjA4LDAsMi45MTcsMS4zMDgsMi45MTcsMi45MTdTNy41MjUsNy44MzMsNS45MTcsNy44MzNTMyw2LjUyNSwzLDQuOTE3UzQuMzA4LDIsNS45MTcsMgoJCSBNNS45MTcsMEMzLjIwMSwwLDEsMi4yMDEsMSw0LjkxN3MyLjIwMSw0LjkxNyw0LjkxNyw0LjkxN3M0LjkxNy0yLjIwMSw0LjkxNy00LjkxN0MxMC44MzMsMi4yMDEsOC42MzIsMCw1LjkxNywwTDUuOTE3LDB6IiAvPgo8L2c%2BCjwvc3ZnPgo%3D'); background-image: url('data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGJhc2VQcm9maWxlPSJmdWxsIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWxuczpldj0iaHR0cDovL3d3dy53My5vcmcvMjAwMS94bWwtZXZlbnRzIj4KPGc%2BCgk8cG9seWdvbiBmaWxsPSIjNjY2IiBwb2ludHM9IjkuMjA3LDYuMTI2IDcuNzkzLDcuNTQxIDExLjc5MywxMS41NDEgMTMuMjA3LDEwLjEyNiIgLz4KCTxwYXRoIGZpbGw9IiM2NjYiIGQ9Ik01LjkxNywyYzEuNjA4LDAsMi45MTcsMS4zMDgsMi45MTcsMi45MTdTNy41MjUsNy44MzMsNS45MTcsNy44MzNTMyw2LjUyNSwzLDQuOTE3UzQuMzA4LDIsNS45MTcsMgoJCSBNNS45MTcsMEMzLjIwMSwwLDEsMi4yMDEsMSw0LjkxN3MyLjIwMSw0LjkxNyw0LjkxNyw0LjkxN3M0LjkxNy0yLjIwMSw0LjkxNy00LjkxN0MxMC44MzMsMi4yMDEsOC42MzIsMCw1LjkxNywwTDUuOTE3LDB6IiAvPgo8L2c%2BCjwvc3ZnPgo%3D');
} }
#uieventDiv { #uieventDiv {
@ -418,7 +431,7 @@ table.row {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
z-index: 2000 z-index: 2000;
} }
#uieventDialog { #uieventDialog {
@ -531,7 +544,7 @@ table.row {
#appendPicSelection span { #appendPicSelection span {
position: absolute; position: absolute;
font-size: 11px; font-size: 11px;
} }
#left6 { #left6 {
left: 5px; left: 5px;
@ -583,7 +596,8 @@ table.row {
width: 95%; width: 95%;
} }
.etable table, .etable table td { .etable table,
.etable table td {
cursor: auto; cursor: auto;
} }
@ -617,15 +631,15 @@ table.row {
/* copy end --------------------------------------------- */ /* copy end --------------------------------------------- */
.etable tr { .etable tr {
width: 100% width: 100%;
} }
.etable tr > :nth-child(1) { .etable tr > :nth-child(1) {
width: 24% width: 24%;
} }
.etable tr > :nth-child(2) { .etable tr > :nth-child(2) {
width: 19% width: 19%;
} }
.etable tr > :nth-child(3) { .etable tr > :nth-child(3) {
@ -700,6 +714,11 @@ div.checkboxSet {
margin: -5px; margin: -5px;
} }
.main .CodeMirror { @font-face {
font-family: Fira Code; font-family: 'Fira Code';
src: url(../../project/fonts/FiraCode-Regular.ttf);
}
.main .CodeMirror {
font-family: 'Fira Code';
} }

View File

@ -739,12 +739,44 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
}); });
// --------------- 战斗伤害 // --------------- 战斗伤害
const { getHeroStatusOn } = Mota.requireAll('fn');
const Damage = Mota.require('module', 'Damage'); const Damage = Mota.require('module', 'Damage');
// 这个数组常量控制着在战斗时哪些属性计算真实属性也就是经过buff加成的属性 // 这个数组常量控制着在战斗时哪些属性计算真实属性也就是经过buff加成的属性
// 如果有属性不会经过buff加成等请将其去除可以提高性能表现 // 如果有属性不会经过buff加成等请将其去除可以提高性能表现
Damage.realStatus = ['atk', 'def', 'mdef', 'hpmax']; Damage.realStatus = ['atk', 'def', 'mdef', 'hpmax'];
// 怪物属性计算,用于获取怪物的初始属性,不经过任何光环加成
// 一般对于坚固、模仿等怪物会在这计算
Mota.rewrite(
Mota.require('class', 'DamageEnemy').prototype,
'calAttribute',
'full',
function () {
const { has } = Mota.Plugin.require('utils_g');
if (this.progress !== 1 && has(this.x) && has(this.floorId))
return;
this.progress = 2;
const special = this.info.special;
const info = this.info;
const floorId = this.floorId ?? core.status.floorId;
const status = getHeroStatusOn(Damage.realStatus, floorId);
// 坚固
if (special.includes(3)) {
info.def = status.atk - 1;
}
// 模仿
if (special.includes(10)) {
info.atk = status.atk;
info.def = status.def;
}
}
);
// 复写系统的伤害计算函数即可,全量复写 // 复写系统的伤害计算函数即可,全量复写
// 函数接受两个参数,分别是怪物信息和勇士信息,返回一个数字作为伤害 // 函数接受两个参数,分别是怪物信息和勇士信息,返回一个数字作为伤害
// 返回null表示不能战斗返回Infinity也可以 // 返回null表示不能战斗返回Infinity也可以
@ -900,7 +932,6 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
); );
// --------------- 地图伤害 // --------------- 地图伤害
const { getHeroStatusOn } = Mota.requireAll('fn');
const caledBetween = new Set(); const caledBetween = new Set();
// 全量复写地图伤害计算,这个计算会调用所有的 DamageEnemy 的地图伤害计算 // 全量复写地图伤害计算,这个计算会调用所有的 DamageEnemy 的地图伤害计算
Mota.rewrite( Mota.rewrite(

View File

@ -33,7 +33,10 @@ const marked: MarkInfo<EnemyIds>[] = [];
* @param id id * @param id id
*/ */
export function markEnemy(id: EnemyIds) { export function markEnemy(id: EnemyIds) {
if (hasMarkedEnemy(id)) return; if (hasMarkedEnemy(id)) {
unmarkEnemy(id);
return;
}
const DamageEnemy = Mota.require('class', 'DamageEnemy'); const DamageEnemy = Mota.require('class', 'DamageEnemy');
const enemy = new DamageEnemy(core.material.enemys[id]); const enemy = new DamageEnemy(core.material.enemys[id]);
enemy.calAttribute(); enemy.calAttribute();

View File

@ -83,8 +83,8 @@
} }
@font-face { @font-face {
font-family: Fira Code; font-family: 'Fira Code';
src: url(/src/fonts/FiraCode-Regular.ttf); src: url(/project/fonts/FiraCode-Regular.ttf);
} }
#non-ui { #non-ui {

View File

@ -108,7 +108,7 @@ function update() {
info.damage = enemy.enemy.calDamage().damage; info.damage = enemy.enemy.calDamage().damage;
const critical = enemy.enemy.calCritical()[0]; const critical = enemy.enemy.calCritical()[0];
info.critical = critical?.atkDelta ?? 0; info.critical = critical?.atkDelta ?? 0;
info.criticalDam = critical.delta ?? 0; info.criticalDam = critical?.delta ?? 0;
info.defDamage = enemy.enemy.calDefDamage(ratio).delta; info.defDamage = enemy.enemy.calDefDamage(ratio).delta;
} }