投掷物,持有上限+1
This commit is contained in:
parent
d1f5070371
commit
5954ead5b5
@ -57,6 +57,7 @@ enum BuffEffectType_e
|
||||
kBET_ShotCharge = 39, //射击蓄力
|
||||
kBET_SelectTargetWithSelfPos = 40, //已自己坐标为中心范围内选取目标,并且批量添加buff
|
||||
kBET_CondAddBuff = 41, //条件添加buff
|
||||
kBET_AddInventory = 42, //扩充库存
|
||||
|
||||
kBET_FollowMaster = 49, //跟随主人
|
||||
kBET_ThroughWall = 50, //穿墙
|
||||
|
@ -991,6 +991,13 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff)
|
||||
list_add_tail(&buff->cond_entry, &cond_buffs_[buff->meta->int_param1]);
|
||||
}
|
||||
break;
|
||||
case kBET_AddInventory:
|
||||
{
|
||||
if (IsValidSlotId(buff->meta->int_param1)) {
|
||||
buff_inventory_[buff->meta->int_param1].num += buff->meta->int_param2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
}
|
||||
|
@ -231,6 +231,7 @@ protected:
|
||||
long long cell_flags_ = 0;
|
||||
CircleCollider* self_collider_ = nullptr;
|
||||
Entity* last_collision_door_ = nullptr;
|
||||
std::array<Inventory, IS_END> buff_inventory_ = {};
|
||||
|
||||
private:
|
||||
CreatureWeakPtr weak_ptr_;
|
||||
|
@ -3144,7 +3144,18 @@ void Human::OnBuffRemove(Buff& buff)
|
||||
buff.ProcRemovePassenger();
|
||||
}
|
||||
break;
|
||||
case kBET_AddInventory:
|
||||
{
|
||||
if (IsValidSlotId(buff.meta->int_param1)) {
|
||||
buff_inventory_[buff.meta->int_param1].num -= buff.meta->int_param2;
|
||||
buff_inventory_[buff.meta->int_param1].num =
|
||||
std::max(0, buff_inventory_[buff.meta->int_param1].num);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!buff.meta->i->only_server()) {
|
||||
|
@ -198,7 +198,7 @@ void RoomObstacle::SpecExplosion()
|
||||
int total_explosion_times = meta->i->explosion_times();
|
||||
if (context_ability && context_ability->GetAttrAbs(kHAT_WeaponExplosionTime) > 0.001f) {
|
||||
total_explosion_times += context_ability->GetAttrAbs(kHAT_WeaponExplosionTime) /
|
||||
obstacle->meta->i->explosion_interval();
|
||||
meta->i->explosion_interval();
|
||||
}
|
||||
if (explosion_times_ >= total_explosion_times) {
|
||||
room->xtimer.DeleteTimer(room->xtimer.GetRunningTimer());
|
||||
|
Loading…
x
Reference in New Issue
Block a user