アイテム計算のひな型
This commit is contained in:
@@ -95,9 +95,9 @@
|
||||
: defender.types,
|
||||
|
||||
// 持ち物情報
|
||||
// effect
|
||||
atk_item_effect: JSON.parse(E), // データの形決まったら調整
|
||||
def_item_effect: JSON.parse(A), // データの形決まったら調整
|
||||
// 来週直したらコメントアウト外す
|
||||
// atk_item_effect: JSON.parse(A), // データの形決まったら調整
|
||||
// def_item_effect: JSON.parse(A), // データの形決まったら調整
|
||||
|
||||
// 攻撃側の技が物理(1)or特殊の判定
|
||||
attack_data_category: attackData.category,
|
||||
@@ -138,15 +138,22 @@
|
||||
total_min_damage_percentage = (d.minDamage * 100) / defender.hp;
|
||||
}
|
||||
function damage(data) {
|
||||
// アイテムで技の威力が上昇する場合の判定
|
||||
console.log("before data.attack_power:",data.attack_power)
|
||||
data.attack_power *= aktPowerIncreasingItems(data)
|
||||
console.log("after data.attack_power:",data.attack_power)
|
||||
// TODO: 来週直す
|
||||
// 命の珠の計算がズレる
|
||||
// アイテムの情報を受け取れるようにする
|
||||
/*
|
||||
// 攻撃側のアイテム補正
|
||||
if (data.atk_item_effect.attack_power !== undefined){
|
||||
// アイテムで技の威力が上昇する場合の判定
|
||||
data.attack_power *= aktPowerIncreasingItems(data)
|
||||
}else {
|
||||
// アイテムでステータスが上昇する場合の判定
|
||||
data.atk_value *=atkStatusIncreasingItems(data)
|
||||
}
|
||||
|
||||
// アイテムでステータスが上昇する場合の判定
|
||||
data.atk_value *=atkStatusIncreasingItems(data)// ここでつまってる
|
||||
// 防御側のアイテム補正
|
||||
data.def_value *=defStatusIncreasingItems(data)
|
||||
|
||||
*/
|
||||
// 基本の計算
|
||||
var step1 = Math.trunc((data.level * 2) / 5 + 2);
|
||||
var step2 = Math.trunc(
|
||||
@@ -201,34 +208,23 @@
|
||||
return 1
|
||||
}
|
||||
function defStatusIncreasingItems(data){
|
||||
console.log(1)
|
||||
if (data.def_item_effect.condition !== undefined){
|
||||
// ブーストエナジー
|
||||
// 技が物理or特殊で分岐
|
||||
if (data.attack_data_category === 1){
|
||||
console.log(2)
|
||||
|
||||
return data.def_item_effect.defense
|
||||
}else {
|
||||
console.log(3)
|
||||
|
||||
return data.def_item_effect.special_defense
|
||||
}
|
||||
}else if (data.def_item_effect.defense !== undefined && data.def_item_effect.special_defense !== undefined){
|
||||
// 進化の輝石
|
||||
// 防御と特防の両方が上がるのでどちらを返してもOK
|
||||
console.log(4)
|
||||
|
||||
return data.def_item_effect.defense
|
||||
} else if (data.def_item_effect.defense === undefined && data.def_item_effect.special_defense !== undefined && data.attack_data_category !==1){
|
||||
// チョッキ
|
||||
// 物理の計算でチョッキの効果を出さないようにするため、防御の計算値がないことと、攻撃が物理ではないことを比較する
|
||||
console.log(5)
|
||||
|
||||
return data.def_item_effect.special_defense
|
||||
}
|
||||
console.log(6)
|
||||
|
||||
return 1
|
||||
}
|
||||
// 全部一気にやると大変なので、一旦基本計算から
|
||||
|
||||
Reference in New Issue
Block a user