This commit is contained in:
aozhiwei 2023-03-28 18:29:36 +08:00
parent dbd5064c69
commit 5b98cb12c6
3 changed files with 87 additions and 0 deletions

View File

@ -498,3 +498,28 @@ float Ability::GetAttrRuduce(int attr_id)
return 0.0f;
}
}
void Ability::GMDelBaseAttr(int type, int attr_id, int idx)
{
}
void Ability::GMClearBaseAttr(int type)
{
}
void Ability::GMDelGrowAttr(int type, int attr_id, int idx)
{
}
void Ability::GMClearGrowAttr(int type)
{
}
std::vector<std::string> Ability::GMShowAttrs()
{
}

View File

@ -37,6 +37,12 @@ class Ability
void RemoveAttrRuduce(AttrRuduceHandle handler);
float GetAttrAddition(int attr_id);
float GetAttrRuduce(int attr_id);
void GMDelBaseAttr(int type, int attr_id, int idx);
void GMClearBaseAttr(int type);
void GMDelGrowAttr(int type, int attr_id, int idx);
void GMClearGrowAttr(int type);
std::vector<std::string> GMShowAttrs();
private:
void Clear();
void RecalcAttrAbs(int attr_id);

View File

@ -166,6 +166,62 @@ void Player::_CMExecCommand(f8::MsgHdr& hdr, const cs::CMExecCommand& msg)
room->DropItem(drop_pos.ToGlmVec3(), equip_meta->id(), 1, 1);
}
}
} else if (cmd == "add_base_attr") {
Creature* target = nullptr;
int type = 0;
int attr_id = 0;
float value = 0;
if (target) {
if (type == 1) {
target->GetAbility()->AddAttrAbs(attr_id, value);
} else {
target->GetAbility()->AddAttrRate(attr_id, value);
}
}
} else if (cmd == "del_base_attr") {
Creature* target = nullptr;
int type = 0;
int attr_id = 0;
int idx = 0;
if (target) {
target->GetAbility()->GMDelBaseAttr(type, attr_id, idx);
}
} else if (cmd == "clear_base_attr") {
Creature* target = nullptr;
int type = 0;
if (target) {
target->GetAbility()->GMClearBaseAttr(type);
}
} else if (cmd == "add_grow_attr") {
Creature* target = nullptr;
int type = 0;
int attr_id = 0;
float value = 0;
if (target) {
if (type == 1) {
target->GetAbility()->AddAttrAddition(attr_id, value);
} else {
target->GetAbility()->AddAttrRuduce(attr_id, value);
}
}
} else if (cmd == "del_grow_attr") {
Creature* target = nullptr;
int type = 0;
int attr_id = 0;
int idx = 0;
if (target) {
target->GetAbility()->GMDelGrowAttr(type, attr_id, idx);
}
} else if (cmd == "clear_grow_attr") {
Creature* target = nullptr;
int type = 0;
if (target) {
target->GetAbility()->GMClearGrowAttr(type);
}
} else if (cmd == "show_attrs") {
Creature* target = nullptr;
if (target) {
}
} else if (cmd == "reset_skill" && cmds.size() >= 2) {
int skill_id = a8::XValue(cmds[1]);
Skill* skill = GetSkill(skill_id);