1
This commit is contained in:
parent
60df47fa29
commit
1c6d10574c
@ -543,7 +543,7 @@ bool Ability::HasDecAttr(int attr_id)
|
||||
}
|
||||
|
||||
|
||||
void Ability::SetSource(AttrHandle handle, std::shared_ptr<std::function<std::string()>> cb)
|
||||
void Ability::SetSource(AttrHandle handle, int source_type, std::shared_ptr<std::function<std::string()>> cb)
|
||||
{
|
||||
auto p = handle.lock();
|
||||
p->get_source = cb;
|
||||
|
@ -2,6 +2,12 @@
|
||||
#include "attrdefine.h"
|
||||
#include "weakptr.h"
|
||||
|
||||
enum AbilitySourceType_e
|
||||
{
|
||||
kAstChip,
|
||||
kAstOther
|
||||
};
|
||||
|
||||
class Ability
|
||||
{
|
||||
public:
|
||||
@ -29,7 +35,7 @@ class Ability
|
||||
void GMDelAttr(int attr_id, int idx);
|
||||
void GMClearAttr();
|
||||
std::vector<std::string> GMShowAttrs();
|
||||
void SetSource(AttrHandle handle, std::shared_ptr<std::function<std::string()>> cb);
|
||||
void SetSource(AttrHandle handle, int source_type, std::shared_ptr<std::function<std::string()>> cb);
|
||||
|
||||
private:
|
||||
void Clear();
|
||||
|
@ -33,7 +33,7 @@ void ModifyAttrBuff::Activate()
|
||||
{
|
||||
return source_name;
|
||||
});
|
||||
owner->GetAbility()->SetSource(attr_handle_, cb);
|
||||
owner->GetAbility()->SetSource(attr_handle_, kAstOther, cb);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -351,7 +351,7 @@ void Player::_CMExecCommand(f8::MsgHdr* hdr, const cs::CMExecCommand& msg)
|
||||
{
|
||||
return source_name;
|
||||
});
|
||||
target->GetAbility()->SetSource(handle, cb);
|
||||
target->GetAbility()->SetSource(handle, kAstOther, cb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3498,7 +3498,7 @@ float Creature::InternalGetSpeed()
|
||||
ruduce = std::max(ruduce, GetAbility()->GetAttrRuduce(kHAT_vSpeedRateIn));
|
||||
#endif
|
||||
float rate = addition + ruduce;
|
||||
finaly_speed *= 1.0f + rate;
|
||||
finaly_speed *= 1.0f + std::min(mt::Param::s().speed_rate_max, rate / mt::Param::s().speed_rf);
|
||||
#ifdef MYDEBUG
|
||||
if (IsPlayer() && finaly_speed > 500) {
|
||||
a8::XPrintf("player speed:%f\n", {finaly_speed});
|
||||
@ -4267,7 +4267,7 @@ void Creature::GenLevelAttr()
|
||||
{
|
||||
return source_name;
|
||||
});
|
||||
GetAbility()->SetSource(handle, cb);
|
||||
GetAbility()->SetSource(handle, kAstOther, cb);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -305,7 +305,7 @@ private:
|
||||
{
|
||||
return source_name;
|
||||
});
|
||||
owner_.Get()->GetAbility()->SetSource(attr_handle, cb);
|
||||
owner_.Get()->GetAbility()->SetSource(attr_handle, kAstOther, cb);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -337,7 +337,7 @@ private:
|
||||
{
|
||||
return source_name;
|
||||
});
|
||||
owner_.Get()->GetAbility()->SetSource(attr_handle, cb);
|
||||
owner_.Get()->GetAbility()->SetSource(attr_handle, kAstChip, cb);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user