MCPcopy Create free account
hub / github.com/EasyRPG/Player / CommandChangeItems

Method CommandChangeItems

src/game_interpreter.cpp:1584–1619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1582}
1583
1584bool Game_Interpreter::CommandChangeItems(lcf::rpg::EventCommand const& com) { // Code 10320
1585 int value;
1586 value = OperateValue(
1587 com.parameters[0],
1588 com.parameters[3],
1589 com.parameters[4]
1590 );
1591
1592 // Add item can't be used to remove an item and
1593 // remove item can't be used to add one
1594 if (com.parameters[0] == 1) {
1595 // Substract
1596 if (value > 0) {
1597 return true;
1598 }
1599 } else {
1600 // Add
1601 if (value < 0) {
1602 return true;
1603 }
1604 }
1605
1606 if (com.parameters[1] == 0) {
1607 // Item by const number
1608 Main_Data::game_party->AddItem(com.parameters[2], value);
1609 } else {
1610 // Item by variable
1611 Main_Data::game_party->AddItem(
1612 Main_Data::game_variables->Get(com.parameters[2]),
1613 value
1614 );
1615 }
1616 Game_Map::SetNeedRefresh(true);
1617 // Continue
1618 return true;
1619}
1620
1621bool Game_Interpreter::CommandChangePartyMember(lcf::rpg::EventCommand const& com) { // Code 10330
1622 Game_Actor* actor;

Callers

nothing calls this directly

Calls 2

AddItemMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected