-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadding_new_items.txt
31 lines (30 loc) · 2.79 KB
/
adding_new_items.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
To add a new affixable item type (a whole new type, not the subtype - it's simpler with subtypes), do the following (don't forget to include all new files to zscript.zsc).
1. Add the base class for the item. It should have the following:
- Be inherited from Actor or any of its descendants
- "affixable" mixin
- rwbaseName string (it's the base name before randomization)
- private void RW_Reset() - a method which handles resetting the item ("un-does" the generation)
- virtual void setBaseStats() - a method which sets base stats (before the generation) for the item
- private void prepareForGeneration() - a method which does anything that is needed before generation. It already has generatedQuality set, so the stat scaling can be done there.
- private void finalizeAfterGeneration() - anything that should be done right after the generation (before the item is used in gameplay). Setting clip ammo, setting current armor amount etc.
- virtual string GetRandomFluffName() - A method which returns random "special" item name to be used with legendary and mythic items.
- Override BeginPlay() like that:
override void BeginPlay() {
RW_Reset();
// There may be other logic, but RW_Reset() is mandatory
}
Keep in mind that any randomizable stats should NOT belong to your new class itself, but should be defined in a separate class, not inherited from anywhere. That's the way it is just because affix logic belongs to data scope, and Actor vars are immutable from there.
2. Add your base class to zscript/affixable/affixable_detector.zs.
3. Add your base class to zscript/player/press_to_pickup_handler.zs.
4. Add pickup routines to zscript/player/player_item_pickup.zs.
5. Add HUD handling in zscript/hud/items_info.zs.
6. Add stats collector routines for your new item base class to zscript/hud/stats_collector (especially artifact_stats_collector.zs and affixable_collect.zs)
7. Add your new base class to zscript/affixable/affixable_generation_helperable.zs.
8. Add base class for affixes for this exact item type.
9. Add those to zscript/affix/affix_instantiator.zs.
10. Describe new affixes in zscript/affix/affixes folder. Keep in mind that you'll need at least two bad ones and five good ones, or the item generation will happily crash. (Neutral affixes count as both good and bad)
11. Describe scrapping logic for items of your class in zscript/player/scrap_item.zs.
-----------------------------------------------------
To add new affixable artifact (as a subtype), inherit its class from the base one (created as described above) and optionally make the following:
- To make monsters drop the new artifacts, add them to zscript/drops/drops_spawner.zs.
- To change some map-placed items with your new artifact, edit zscript/drops/map_placed_items_replacements_handler.zs.