Assemberist / cppRpg

0 stars 0 forks source link

Create inventory #14

Closed Assemberist closed 1 year ago

Assemberist commented 2 years ago

Inventory should contain items. Items can't be presented.

Assemberist commented 2 years ago

It was not difficult.

Assemberist commented 2 years ago

There is needed to implement some things: 1) Calculation of effects for object with items. 2) Interface for using items. 3) Improvement for menu (using enums as index).

Assemberist commented 2 years ago

1 - in process. New flag "shared" added to effect state for providing of effects. 2 - postponed until other targets are not ready. 3 - #15 created.

Assemberist commented 2 years ago

New flags should be placed in definition of effect due to shared effects will conflict with permanent.

Assemberist commented 2 years ago

Common api for item handling is written. Now TUI can be updated. But change of object model breaks the claculation of effects. Old calculation was commented to compilation do complete. But program fails when it attempts to calculate effects. It should be fixed.

Assemberist commented 2 years ago

It was dividing on 0.

Assemberist commented 2 years ago

Graphical field is working, but presentation is only created. Now state machine should be bringed to accordance with new model.

Assemberist commented 1 year ago

User unterface can be separated to several functions that will process one state. Also plantuml diagramm can be added in repo in separate foulder

Assemberist commented 1 year ago

States Loot and Inventory are partially implemented. But in current realization printed wrong elements (with shift "-1").

Assemberist commented 1 year ago

Allocation of inventory is done but clearing of this memory should be done.

Assemberist commented 1 year ago

States Loot and Inventory are partially implemented. But in current realization printed wrong elements (with shift "-1").

Comma was missed after one item name.

Assemberist commented 1 year ago

Planned algorythm of state machine in user_ifc is printed on diagramm.

cppRpg_user_ifc New actions already added:

1) When character is moving to any object he will loot it. 2) Opening of characters inventory by button 'i' in moving state. 3) Un/equipment items in the inventory. 4) Return to moving from state "Open inventory".

Old states should also be updated so they are not highlighted.

Assemberist commented 1 year ago

Several LOOT operations complete. Next state to be implemented is LOOT_INVENTORY. Also inventory contain limited amount of lines for text. Elements starts to be displayed on one line when amount of elements more of lines.

Assemberist commented 1 year ago

Un/equip can wrongly change elements. Now inventory can just be recreated every time but later it can be reworked in #17.

Assemberist commented 1 year ago

It is difficult process of using spells and items in one state. New state will be created for item handling. It allows less change old logic.

Assemberist commented 1 year ago

It is impossible perform developement interface as single function. I can't understand what means one or two variable and what var should i use. This improvement will be done because it increases development speed.

Assemberist commented 1 year ago

It is difficult process of using spells and items in one state. New state will be created for item handling. It allows less change old logic.

cppRpg_user_ifc

Assemberist commented 1 year ago

I guess using "time" field of effect to describe how much charges left is bad idea: action differs from name the field. And time is description of effect, how long it will be.

Assemberist commented 1 year ago

Points at 11.12.2022

I guess using "time" field of effect to describe how much charges left is bad idea: action differs from name the field. And time is description of effect, how long it will be.

Definition of effect field should be updated. And also there is some thinks about items.

1) Using of bit fields "is_shared" and "is_permanent" difficult. Using of enums is much easier. I select several types of effects: a) Permanent effects. This effects are presented all time in object. They calculated on base class and de/buffs. It can not be shard or transfered (without haks). b) Buff. This effect is needed to modify permanent effects. When it used it transfered as permanent. (Or as baff) c) PermaShared effects. This effects presented on object and will be shared on contact. They will be transfered as shared. d) Shared effects. This effects have time of execution and will be removed when the time will expired. Shared on equipment and can be nearly stayed targets. e) Pure effects. This effects acts directly with target and does not shared. f) Charges. This effects placed in object and used by user. Will be removed after it is exhaused. Requires additional field of amount charges. Can interact with other effects. g) Batterys. As charges but can be recharged.

2) Items does not have spells, but they should have possibility make any actions: instantly heal, or use a spell. It can be done as property "encancement". But it can be placed separately as array from several slots ~3-5 where can be placed enhancement. 3) Permanent effects are presented permanently, so they don't need field time, only value. Propertyes can be used instead.

Additional info at 11.19.2022

Raw effecs should not be transfered or used as charges. Transfer it in scope of spell is better. But spells should be pointed to a target and have a strategy for executing. So i guess to introduce new class "slot" that will be included in item. This class should spcify:

a. Who should be choosed as target for spell. b. How many charges there. c. Behavior when no one charge left. d. What will be trigger.

So charges and batterys will be not types of effects but on of specific. Buffs can be transfered as PermaShared effects. So question about implementstion of buffs is hunged.

4) Class diagramm can be create Already there is several entytyes and new one introduction is planned.

Assemberist commented 1 year ago

Also diagram of effect transfer flow should be added because there are several ways to transfer effects between objects, items and map.

Assemberist commented 1 year ago

Updates of planned state machine

cppRpg_user_ifc

Independent parts of item handling were implemented. Now other code parts that connected with them should be implemented/updated.

Now only inventory and moving works fine. 1) Spell shop is not implemented, 2) Observation mode is not implemented, 3) Using of spells and choose target for spell is broken,

(2) and (3) are required for continuation because debugging is pain without (2) (read effects with gdb not cool) and spells for items connected with items.

So this issue will be postponed until this issues implemented.

The issue blocked by #20, The issue blocked by #19.

Assemberist commented 1 year ago

Progress in GUI.

TUIInterfaceStateMReady

I decide to deliver the issue after some changes. One planned punct was not implemented: using spells by items. It can be done in the scope of #20 or as separate activity.

Second activity also don't blocks delivery due to flow of effects possily does not broken. But if yes then it does not matched with introduction of items. And it will just another punct for tests. Note about that already added.