Skip to content

Commit

Permalink
Merge branch 'release/1.10.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
madonoharu committed Sep 23, 2022
2 parents f001518 + 6bf7ff6 commit e56c438
Show file tree
Hide file tree
Showing 11 changed files with 106 additions and 93 deletions.
4 changes: 2 additions & 2 deletions crates/fleethub-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fleethub-core"
version = "1.10.6"
version = "1.10.7"
authors = ["Madono <madonoharu@gmail.com>"]
edition = "2021"
description = "fleethub-core"
Expand All @@ -15,7 +15,7 @@ default = ["console_error_panic_hook"]
[dependencies]
wasm-bindgen = { version = "0.2.83" }
js-sys = "0.3.60"
serde = { version = "1.0.144", features = ["derive"] }
serde = { version = "1.0.145", features = ["derive"] }
serde_json = "1.0.85"
serde_with = "2.0.1"
rand = { version = "0.8.5", features = ["small_rng"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/fleethub-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fleethub-core",
"version": "1.10.6",
"version": "1.10.7",
"license": "UNLICENSED",
"sideEffects": false,
"exports": {
Expand Down
5 changes: 4 additions & 1 deletion crates/fleethub-core/src/attack/attack_power.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ impl AttackPowerParams {

// https://twitter.com/hedgehog_hasira/status/1569717081016520704
postcap = postcap_general_mod.apply(postcap);
postcap *= self.historical_mod;
// https://twitter.com/agosdufovj/status/1545099167835762688
postcap = AttackPowerModifier::new(self.historical_mod, 0.0)
.compose(self.custom_mods.historical_mod)
.apply(postcap);

let normal = postcap;
let critical = (normal * 1.5 * self.proficiency_critical_mod).floor();
Expand Down
1 change: 1 addition & 0 deletions crates/fleethub-core/src/types/attack_power_modifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,5 @@ pub struct CustomPowerModifiers {
pub precap_mod: AttackPowerModifier,
pub postcap_mod: AttackPowerModifier,
pub basic_power_mod: AttackPowerModifier,
pub historical_mod: AttackPowerModifier,
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fleethub",
"version": "1.10.6",
"version": "1.10.7",
"private": true,
"license": "UNLICENSED",
"author": "madono (https://github.com/MadonoHaru) <madonoharu@gmail.com>",
Expand Down Expand Up @@ -37,7 +37,7 @@
"@fh/admin": "workspace:*",
"@fh/utils": "workspace:*",
"@next/eslint-plugin-next": "^12.3.1",
"@swc/core": "^1.3.2",
"@swc/core": "^1.3.3",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@types/fs-extra": "^9.0.13",
Expand Down
2 changes: 1 addition & 1 deletion packages/kcs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"devDependencies": {
"@swc/cli": "^0.1.57",
"@swc/core": "^1.3.2",
"@swc/core": "^1.3.3",
"fleethub-core": "npm:latest"
}
}
6 changes: 3 additions & 3 deletions packages/site/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fh/site",
"version": "1.10.6",
"version": "1.10.7",
"license": "UNLICENSED",
"author": "madono (https://github.com/MadonoHaru)",
"main": "index.js",
Expand Down Expand Up @@ -36,7 +36,7 @@
"equipment-bonus": "npm:latest",
"fast-json-stable-stringify": "^2.1.0",
"fleethub-core": "npm:latest",
"gkcoi": "^1.4.3",
"gkcoi": "^1.4.4",
"http-status-codes": "^2.2.0",
"immer": "^9.0.15",
"literal-case": "^1.0.0",
Expand All @@ -49,7 +49,7 @@
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-dom": "18.2.0",
"react-redux": "^8.0.2",
"react-redux": "^8.0.4",
"recharts": "2.1.12",
"redux": "^4.2.0",
"redux-persist": "^6.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ const AttackPowerDetails: React.FCX<AttackPowerDetailsProps> = ({
label={t("postcap_mod")}
mod={custom_mods.postcap_mod}
/>
<AttackPowerModifierLabel
label={t("historical_mod")}
mod={custom_mods.historical_mod}
/>
</>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import { Divider } from "../../atoms";

import AttackPowerModifierForm from "./AttackPowerModifierForm";

const KEYS = ["basic_power_mod", "precap_mod", "postcap_mod"] as const;
export const CUSTOM_POWER_MODIFIERS_KEYS = [
"basic_power_mod",
"precap_mod",
"postcap_mod",
"historical_mod",
] as const;

export type CustomPowerModifiersFormProps = {
value: CustomPowerModifiers;
Expand All @@ -30,7 +35,7 @@ const CustomPowerModifiersForm: React.FCX<CustomPowerModifiersFormProps> = ({

return (
<Stack className={className} style={style} gap={1} mb={1}>
{KEYS.map((key) => (
{CUSTOM_POWER_MODIFIERS_KEYS.map((key) => (
<React.Fragment key={key}>
<Divider label={t(key)} />
<AttackPowerModifierForm value={value[key]} onChange={bind(key)} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import React from "react";
import { useAppDispatch, useModal } from "../../../hooks";
import { shipsSlice } from "../../../store";

import CustomPowerModifiersForm from "./CustomPowerModifiersForm";

const KEYS = ["basic_power_mod", "precap_mod", "postcap_mod"] as const;
import CustomPowerModifiersForm, {
CUSTOM_POWER_MODIFIERS_KEYS,
} from "./CustomPowerModifiersForm";

function hasMod(
mod: AttackPowerModifier | undefined
Expand Down Expand Up @@ -58,14 +58,14 @@ const CustomPowerModifiersDialog: React.FCX<
>
{visibleMods ? (
<Stack>
{KEYS.map((key) => {
{CUSTOM_POWER_MODIFIERS_KEYS.map((key) => {
const mod = mods[key];

if (!hasMod(mod)) {
return null;
}

const label = t(key as keyof CustomPowerModifiers);
const label = t(key);

return (
<span key={key}>{`${label} x${mod.a ?? "1.0"} +${
Expand Down
Loading

1 comment on commit e56c438

@vercel
Copy link

@vercel vercel bot commented on e56c438 Sep 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

fleethub – ./

jervis.vercel.app
fleethub-madonoharu.vercel.app
fleethub-git-main-madonoharu.vercel.app

Please sign in to comment.