Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add weapon categories to more tools #2708

Merged
merged 5 commits into from
Apr 28, 2023

Conversation

chaosvolt
Copy link
Member

@chaosvolt chaosvolt commented Apr 26, 2023

Summary

SUMMARY: Balance "Grant weapon categories to more tools"

Purpose of change

Some simple weapon category things spotted while working on something else.

Describe the solution

  1. Added 1H_AXES and HOOKED_POLES category to stone adze, this being what the hoe uses.
  2. Added HAND_AXES category to hatchet and ice axe, being two small axe-like tools.
  3. Added CLUBS category to crowbar, makeshift crowbar, claw bar, wooden smoother, digging stick, stone shovel, shovel, torches, and entrenching tool, with HOOKED_POLES additionally added to crowbar, makeshift crowbar, and claw bar per request.
  4. Added 1H_HAMMERS category to stone hammer.
  5. Added KNIVES category to screwdriver and soldering iron, basically a shiv. Also to x-acto knife and scalpel.
  6. Added HOOKED_POLES category to scythe.
  7. Added SHORT_SWORDS and HOOKED_POLES categories to sickle, the latter per request.
  8. Added BATONS category to heavy-duty flashlights.
  9. Added GLAIVES category to lajatangs and chainsaw lajatangs. While obviously not the most efficient choice, idea is this makes these infamous weapons actually applicable to some vanilla styles.
  10. Misc: changed category of homewrecker from 1H_HAMMERS to FLAILS as its recipe and description implies metal heads secured by cordage.

Describe alternatives you've considered

  1. Adding a category for pickaxes and chainsaws, or at least running chainsaws. Maybe also grapnel, grip hook, and such. EDIT: Didn't notice, pickaxe actually already has HOOKED_POLES category.
  2. Adding styles that actually use some of the other weapon categories we have here that go unused currently, like clubs.

Testing

  1. Checked affected files for syntax and lint errors.
  2. Load-tested file changes in test build.

Additional context

@github-actions github-actions bot added the JSON related to game datas in JSON format. label Apr 26, 2023
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

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

changes look good. however, i think some tools could be flagged as HOOKED_POLES.

data/json/items/tool/entry_tools.json Outdated Show resolved Hide resolved
data/json/items/tool/landscaping.json Outdated Show resolved Hide resolved
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

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

LGTM.

@chaosvolt
Copy link
Member Author

Only thing I'd note is HOOKED_POLES is also used by the polearm martial art if I recall.

@scarf005
Copy link
Member

scarf005 commented Apr 27, 2023

i see. maybe weapon categories should be rewritten someday to only account for their shape, for example
knife -> short blade
medival knife -> long blade
quarterstaff -> long pole
tonfa -> T-shaped
hooked poles -> Hook-shaped pole

@chaosvolt
Copy link
Member Author

Could be fair to mess with it more in the future, yeah. It already also includes 1H_HAMMERS which includes the small tool hammer so suppose it's already a bit odd already.

@scarf005
Copy link
Member

scarf005 commented Apr 27, 2023

or we could go even more extreme and replace all these weapon categories to combo of size + shape

Weapon Length Shape
knife short blade
hammer short hammer
2hand hammer long hammer
tonfa medium T-shape
crowbar medium hooked
glaive long hooked
sickle short hooked

@chaosvolt
Copy link
Member Author

Distinguishing between small, medium, and large (like daggers, one-handed swords, and two-handed swords for example) and between general shape could work, yeah. Just something to mess about with another time.

@scarf005
Copy link
Member

scarf005 commented Apr 27, 2023

yeah the migration can be perfectly automated, let's think on that later.
i need to go to bed shortly after, but looks good to merge rn.

Example migration script
import { match } from "npm:ts-pattern"
import { distinct } from "https://deno.land/[email protected]/collections/distinct.ts"

type OldCategory = "club" | "hooked_pole" | "knife"
type Length = "SHORT" | "MEDIUM" | "LONG"
type Shape = "POLE" | "HOOK" | "BLADE"

type NewCat = (l: Length) => (s: Shape) => () => [Length, Shape]
const newCat: NewCat = (l) => (s) => () => [l, s]

type MigrateCategory = (c: OldCategory) => string[]
const migrateCategory: MigrateCategory =
	(c) => match(c)
		.with("club", newCat("LONG")("POLE"))
		.with("hooked_pole", newCat("LONG")("HOOK"))
		.with("knife", newCat("SHORT")("BLADE"))
        .exhaustive()

const flags = [ "club", "hooked_pole" ] as const
const newFlags = distinct(flags.flatMap(migrateCategory))

console.log(newFlags) // [ "LONG", "POLE", "HOOK" ]

@chaosvolt chaosvolt merged commit 0d8b8f1 into cataclysmbnteam:upload Apr 28, 2023
@chaosvolt chaosvolt deleted the smol-hatchet-updoots branch April 28, 2023 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JSON related to game datas in JSON format.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants