diff --git a/components/Abstracts/WeaponCardBase.tscn b/components/Abstracts/WeaponCardBase.tscn index 4066261..41f3f0a 100644 --- a/components/Abstracts/WeaponCardBase.tscn +++ b/components/Abstracts/WeaponCardBase.tscn @@ -29,6 +29,7 @@ offset_right = 350.0 offset_bottom = 304.0 theme_override_styles/panel = SubResource("StyleBoxFlat_n2ewr") script = ExtResource("1_g802t") +costBeachball = 500 metadata/_edit_lock_ = true [node name="sounds" type="Node2D" parent="."] diff --git a/scripts/Contents/Weapons/BigLaser.gd b/scripts/Contents/Weapons/BigLaser.gd index 7b21d51..e226881 100644 --- a/scripts/Contents/Weapons/BigLaser.gd +++ b/scripts/Contents/Weapons/BigLaser.gd @@ -4,7 +4,7 @@ class_name BigLaserWeapon func update(to: int, origin: Dictionary, _entity: EntityBase): origin["atk"] += 5 * to * soulLevel - origin["time"] /= 1.05 ** soulLevel * to + origin["time"] /= 1 + 0.05 * to * soulLevel return origin func attack(entity: EntityBase): var weaponPos = entity.findWeaponAnchor("normal") diff --git a/scripts/Contents/Weapons/LGBTWeapon.gd b/scripts/Contents/Weapons/LGBTWeapon.gd index d59ff72..09f21b1 100644 --- a/scripts/Contents/Weapons/LGBTWeapon.gd +++ b/scripts/Contents/Weapons/LGBTWeapon.gd @@ -7,7 +7,7 @@ func update(to: int, origin: Dictionary, _entity: EntityBase): origin["count"] += to * soulLevel origin["power"] += 0.05 * to * soulLevel origin["trace"] += 0.25 * to * soulLevel - origin["angle"] /= 1.05 ** soulLevel * to + origin["angle"] /= 1 + 0.05 * to * soulLevel return origin func attack(entity: EntityBase): var weaponPos = entity.findWeaponAnchor("normal") diff --git a/scripts/Contents/Weapons/VectorStarWeapon.gd b/scripts/Contents/Weapons/VectorStarWeapon.gd index b74b1cf..cb6dcc9 100644 --- a/scripts/Contents/Weapons/VectorStarWeapon.gd +++ b/scripts/Contents/Weapons/VectorStarWeapon.gd @@ -4,8 +4,8 @@ class_name VectorStarWeapon func update(to: int, origin: Dictionary, _entity: EntityBase): origin["atk"] += 5 * to * soulLevel - origin["forwardtime"] /= 1.05 ** soulLevel * to - origin["maxcount"] += 1 * level * soulLevel + origin["forwardtime"] /= 1 + 0.05 * to * soulLevel + origin["maxcount"] += 1 * to * soulLevel return origin func attack(entity: EntityBase): var weaponPos = entity.findWeaponAnchor("normal") diff --git a/scripts/Structs/Weapon.gd b/scripts/Structs/Weapon.gd index 678cd7a..e16ebe2 100644 --- a/scripts/Structs/Weapon.gd +++ b/scripts/Structs/Weapon.gd @@ -7,7 +7,7 @@ class_name Weapon @export var quality: WeaponName.Quality = WeaponName.Quality.COMMON @export var typeTopic: WeaponName.TypeTopic = WeaponName.TypeTopic.IMPACT @export var soulLevel: int = 1 -@export var costBeachball: int = 500 +@export var costBeachball: int = 100 @export var store: Dictionary = { "atk": 10 } @@ -100,20 +100,28 @@ func rebuildInfo(): beachballLabel.text = str(costBeachball) soulLabel.text = str(soulLevel) descriptionLabel.text = buildDescription() +func formatValue(value: Variant, type: FieldStore.DataType) -> String: + if type == FieldStore.DataType.VALUE: + return "%.2f" % value + elif type == FieldStore.DataType.INTEGER: + return "%d" % value + elif type == FieldStore.DataType.PERCENT: + return ("%d" % (value * 100)) + "%" + elif type == FieldStore.DataType.ANGLE: + return "%.1f°" % value + else: + return str(value) func buildDescription() -> String: + var current = store + var next = update(level + 1, originalStore.duplicate(), UIState.player) var result = descriptionTemplate for key in store.keys(): - var data = store[key] + var data = current[key] + var nextData = next[key] var type = storeType.get(key, FieldStore.DataType.VALUE) - if type == FieldStore.DataType.VALUE: - data = "%.2f" % data - elif type == FieldStore.DataType.INTEGER: - data = "%d" % data - elif type == FieldStore.DataType.PERCENT: - data = ("%d" % (data * 100)) + "%" - elif type == FieldStore.DataType.ANGLE: - data = "%.1f°" % data - result = result.replace("$" + key, "[color=cyan]%s[/color]" % data) + data = formatValue(data, type) + nextData = formatValue(nextData, type) + result = result.replace("$" + key, "[color=cyan]%s[/color]→[color=yellow]%s[/color]" % [data, nextData]) return "[center]%s[/center]" % result func readStore(key: String, default: Variant = null): return store.get(key, default)