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

Martial arts, part 1 #3104

Merged
merged 21 commits into from Sep 21, 2013

Conversation

Projects
None yet
3 participants
@swwu
Copy link
Contributor

commented Sep 18, 2013

Breaking out martial arts into its own, separate system that isn't just fake weapons.

  • Martial arts defined in /data/martialarts.json. Can have buffs, etc etc. System in more detail (but slightly out of date) here http://smf.cataclysmdda.com/index.php?topic=3089.0
  • Martial arts are now a separate class of "object", rather than just being weapons. Still accessed/changed via _ key. Only way right now to learn martial arts is to choose "martial arts adept" trait.
  • Offensive techniques defined in /data/techniques.json. The techniques field on weapons now references these techniques (see, WIDE, BRUTAL, SWEEP, RAPID, etc in that file). Not certain if all weapon-based techniques have been added, but should be fairly trivial to re-add the missing ones. Should be easy to tag techniques with "goal": whatever to make them compatible with the goal system from #1565.
  • Defensive techniques mostly removed (only feints stay). Blocks now occur by default. Blocking modifiers to come at some future date (to allow for things like defensive throw/disarm, etc). Although there are no WBLOCK techniques in the JSON, WBLOCK_n can still be added to a weapon's techniques list to increase its blocking efficacy.
  • There's no UI for viewing descriptions/etc on martial arts (yet), but they do more or less the same things as they used to.

swwu added some commits Sep 3, 2013

basic martial arts functionality.
* added martial arts as first-class objects instead of items, stored in
player::ma_styles
  - martial arts attach diseases to player representing buffs (see ma_buff),
    restricted by skills and current weapon-wielding status
  - can attach buffs on-hit or "statically" (on player::reset)
  - buffs can stack based on their max_stacks trait, and last for buff_duration
    turns
  - martial arts data stored in data/raw/martialarts.json, all
    buffs/conditions/etc are editable
* implemented karate in new JSON system
* added a "test_karate" style, will remove later
Fully functional martial arts framework v1
* techniques work
* technique restrictions work
* technique custom strings work
* added two "demo" styles, coward and berserker
* Martial Arts Training now gives all implemented styles (karate, aikido, demo
styles). Other martial arts traits won't do anything because they still give you the
old martial arts items which are no longer accessible.
More martial arts changes
* added capoeira, judo, tai chi
* added "throw_immune", "block", "block_<stat>" as buff effects
* buffs can now depend on other buffs via "req_buffs"
Merge branch 'master' into martial_arts
Conflicts:
	game.h
	monmove.cpp
	player.cpp
	pldata.h

Also added martial arts/techniques json data + character creation
@ianestrachan

This comment has been minimized.

Copy link
Contributor

commented Sep 18, 2013

Regarding not being able to view descriptions (since they're not fake items any more), would a reasonable workaround be adding another screen on the Help menu? Press ? then the menu's key and you can read the descriptions of all of them.

This would have the added benefits of:

  • Being able to compare styles side-by-side easily
  • Being able to examine styles before taking the appropriate character creation trait, by looking at styles from the title screen's link to the help/instructions.
@swwu

This comment has been minimized.

Copy link
Contributor Author

commented Sep 18, 2013

@ianestrachan That seems like a reasonable solution to me.

@swwu

This comment has been minimized.

Copy link
Contributor Author

commented Sep 19, 2013

Woops, that last one wasn't meant to go on this branch, more of a general bugfix. I can cull it and put it on a separate branch if necessary, I think it's a 2-line diff.

Merge branch 'master' into martial_arts
Conflicts:
	item.cpp
	itype.h
	melee.cpp
	pldata.h
@kevingranade

This comment has been minimized.

Copy link
Member

commented Sep 20, 2013

I'm happy with all the functional code, the only things I'm not happy with are the commented out dead code, and regressions unrelated to martial arts (flaming weapons, and weapon-based blocking). I'm fine with temporarily nuking traditional martial arts, and then building them back up again, but I don't want to break weapons if at all possible.
If necessary I can fix both of these, but I suspect it'll be faster if you do it, particularly the dead code removal.
If you want a note about future development, "// TODO: add bla feature here" is ok in the short term, but just commented out code doesn't tell anyone why it's commented out, makes things messy.
The flaming and weapon block stuff is probably as simple as switching weapon.has_technique(TEC_BLA) to weapon.has_flag("BLA").

@swwu

This comment has been minimized.

Copy link
Contributor Author

commented Sep 20, 2013

Weapon blocking should actually work (player::block_hit checks for WBLOCK_n flags on weapons and increases block efficacy). I forgot about flaming weapons completely though, I'll put those back in.
All the dead code is only there so I could "remember" what the old code did and reproduce it in the new system, all of it can just be deleted. I'll get those out in the next pass too.

swwu added some commits Sep 21, 2013

Merge branch 'master' into martial_arts
Conflicts:
	data/json/mutations.json
	disease.cpp
	game.cpp
	npc.cpp
	player.cpp
@swwu

This comment has been minimized.

Copy link
Contributor Author

commented Sep 21, 2013

@kevingranade Okay flaming weapons are back in (I moved "FLAMING" from technique to flag as suggested and changed all the json correspondingly, it otherwise works exactly the same). Weapon block should be working too.

@kevingranade kevingranade merged commit b1437a0 into CleverRaven:master Sep 21, 2013

1 check passed

default Merged build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.