Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions public/locales/de-DE/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
"flyff_universe_character_simulator": "Flyff Universe Charakter Simulator",
"loaded_build": "Geladener Build:",
"stat_points_available": "Statpunkte verfügbar",
"sex_label": "Geschlecht",
"sex_ignore": "Ignorieren",
"sex_male": "Männlich",
"sex_female": "Weiblich",
"no_item_selected": "Kein Item ausgewählt.",
"no_item_selected_explanation": "Füge Items hinzu und bearbeite deren Stats und Eigenschaften",
"equipment_tab_name": "Equipment",
Expand Down
6 changes: 5 additions & 1 deletion public/locales/en-US/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
"player_target": "Other player target",
"enter_build_name": "Enter a name for the build",
"flyff_universe_character_simulator": "Flyff Universe Character Simulator",
"loaded_build": "Loaded build:",
"loaded_build": "Loaded build",
"stat_points_available": "stat points available",
"sex_label": "Sex",
"sex_ignore": "Ignore",
"sex_male": "Male",
"sex_female": "Female",
"no_item_selected": "No item selected.",
"no_item_selected_explanation": "Add items to the inventory and select them to edit their stats and properties.",
"equipment_tab_name": "Equipment",
Expand Down
6 changes: 5 additions & 1 deletion public/locales/pt-BR/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
"player_target": "Outro jogador como alvo",
"enter_build_name": "Digite um nome para a build",
"flyff_universe_character_simulator": "Simulador de Personagem Flyff Universe",
"loaded_build": "Build carregada:",
"loaded_build": "Build carregada",
"stat_points_available": "pontos de status disponíveis",
"sex_label": "Sexo",
"sex_ignore": "Ignorar",
"sex_male": "Masculino",
"sex_female": "Feminino",
"no_item_selected": "Nenhum item selecionado.",
"no_item_selected_explanation": "Adicione items ao inventário e os selecione para editar seus status e propriedades.",
"equipment_tab_name": "Equipamento",
Expand Down
6 changes: 5 additions & 1 deletion public/locales/zh-CN/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
"player_target": "其他玩家",
"enter_build_name": "输入构建名称",
"flyff_universe_character_simulator": "Flyff Universe 角色模拟器",
"loaded_build": "已加载构建:",
"loaded_build": "已加载构建",
"stat_points_available": "可用属性点数",
"sex_label": "性别",
"sex_ignore": "忽略",
"sex_male": "男性",
"sex_female": "女性",
"no_item_selected": "未选择道具。",
"no_item_selected_explanation": "请将道具加入背包并选择它们,以编辑其属性和数值。",
"equipment_tab_name": "装备",
Expand Down
6 changes: 5 additions & 1 deletion public/locales/zh-TW/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
"player_target": "其他玩家",
"enter_build_name": "輸入建構名稱",
"flyff_universe_character_simulator": "Flyff Universe 角色模擬器",
"loaded_build": "已載入建構:",
"loaded_build": "已載入建構",
"stat_points_available": "可用屬性點數",
"sex_label": "性別",
"sex_ignore": "忽略",
"sex_male": "男性",
"sex_female": "女性",
"no_item_selected": "未選擇道具。",
"no_item_selected_explanation": "請將道具加入背包並選擇它們,以編輯其屬性和數值。",
"equipment_tab_name": "裝備",
Expand Down
20 changes: 20 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ function App() {
jobOptions[k] = v.name.en;
}

const sexOptions = {
ignore: t("sex_ignore"),
male: t("sex_male"),
female: t("sex_female"),
};

function changeJob(newJobId) {
if (newJobId == Context.player.job.id) {
return;
Expand All @@ -47,6 +53,16 @@ function App() {
setState(!state); // Just to re-render...
}

function changeSex(newSex) {
const sex = newSex === "ignore" ? null : newSex;
if (sex == Context.player.sex) {
return;
}

Context.player.sex = sex;
setState(!state); // Just to re-render...
}

function setPlayerStat(statKey, statValue) {
statValue = Number(statValue);
if (Context.player[statKey] != statValue) {
Expand Down Expand Up @@ -218,6 +234,10 @@ function App() {
<div className="stat-block">
<NumberInput min={Context.player.job.minLevel} max={Context.player.job.maxLevel} label={"Level"} onChange={(v) => setPlayerStat("level", v)} value={Context.player.level} />
<i>{Context.player.getRemainingStatPoints()}/{Context.player.getTotalStatPoints()} {t("stat_points_available")}</i>
<div style={{ display: "flex", alignItems: "center", justifyContent: "space-between" }}>
{t("sex_label")}
<Dropdown options={sexOptions} onSelectionChanged={changeSex} valueKey={Context.player.sex ?? "ignore"} />
</div>
</div>
<div className="stat-block">
<div className="stat-row">
Expand Down
9 changes: 9 additions & 0 deletions src/flyff/flyffentity.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export default class Entity {
activeAchievements = []; // FWC achievements whose stat bonuses are applied.
equipSets = []; // Current armor sets equipped. Cached because the lookup is really slow.
level = 1;
sex = null;
str = 15;
sta = 15;
dex = 15;
Expand Down Expand Up @@ -192,6 +193,10 @@ export default class Entity {
delete shrinked.level;
}

if (shrinked.sex === null) {
delete shrinked.sex;
}

if (shrinked.str === 15) {
delete shrinked.str;
}
Expand Down Expand Up @@ -652,6 +657,10 @@ export default class Entity {
return false;
}

if (this.sex != null && itemProp.sex != undefined && itemProp.sex != this.sex) {
return false;
}

return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/styles/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
// Centering pushed the shorter Level block (input + points note) down.
align-items: flex-start;
justify-content: center;
gap: 5px;
gap: 10px;
flex-grow: 1;

.stat-block {
Expand Down