Sqr/character/atmage/pushout/ap_pushoutexplosion.nut

99 lines
2.9 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

VAR_PUSH_OUT_EXPLOSION_OLD_STATE <- 0
function sq_AddFunctionName(appendage)
{
appendage.sq_AddFunctionName("proc", "proc_appendage_PushOutExplosion")
appendage.sq_AddFunctionName("onStart", "onStart_appendage_PushOutExplosion")
appendage.sq_AddFunctionName("onEnd", "onEnd_appendage_PushOutExplosion")
}
function onStart_appendage_PushOutExplosion(appendage)
{
if(!appendage) {
return;
}
local parentObj = appendage.getParent();
if(!parentObj) {
appendage.setValid(false);
return;
}
local var = appendage.getVar();
var.setInt(VAR_PUSH_OUT_EXPLOSION_OLD_STATE,parentObj.getState());
}
function proc_appendage_PushOutExplosion(appendage)
{
if(!appendage && !appendage.isValid()) {
return;
}
local parentObj = appendage.getParent();
local sourceObj = appendage.getSource();
sourceObj = sq_GetCNRDObjectToSQRCharacter(sourceObj);
if(!sourceObj || !parentObj) {
appendage.setValid(false);
return;
}
local var = appendage.getVar();
local oldState = var.getInt(VAR_PUSH_OUT_EXPLOSION_OLD_STATE);
var.setInt(VAR_PUSH_OUT_EXPLOSION_OLD_STATE,parentObj.getState());
if(oldState == STATE_STAND && parentObj.getState() != STATE_DOWN){
appendage.setValid(false);
return;
}
if(parentObj.getState() == STATE_DOWN && parentObj.getDownState() >=1 || ( oldState == STATE_DOWN && parentObj.getState() != STATE_DOWN) )
{
if(sourceObj.isMyControlObject())
{
local level = sq_GetSkillLevel(sourceObj, SKILL_PUSH_OUT);
// 醱问? 舆渗等嘐虽
local attackPower = sourceObj.sq_GetPowerWithPassive(SKILL_PUSH_OUT, STATE_PUSH_OUT, 2, -1, 1.0);
local sizeRate = sq_GetIntData(sourceObj, SKILL_PUSH_OUT, 0);
print(sizeRate);
// 模蝶 : CNEarthBreak谛 翕橾? 匙击 饵辨?
sq_BinaryStartWrite();
// 0:(BOOL) ?筒 嵘鼠 0:絮筒
sq_BinaryWriteBool(0);
// 1:(float) 奢问溘
sq_BinaryWriteFloat(attackPower.tofloat());
// 2:(WORD) 饵桧锷
sq_BinaryWriteWord(sizeRate);
// 3:(WORD) 嗥办朝 ?
sq_BinaryWriteWord(200);
// 4:(bool) ?潍 蝶鉴 嵘鼠
local isExSkill = false;
isExSkill = sq_GetSkillLevel(sourceObj, SKILL_PUSH_OUT_EX) > 0;
sq_BinaryWriteBool(isExSkill);
// 5:(DWORD) parent id : ?潍 蝶鉴橾 阳朝 濠褐紫 醱问?蒂 蜃朝棻.
if(!isExSkill)
sq_BinaryWriteDword(sq_GetObjectId(parentObj));
local x = sourceObj.getXPos() > parentObj.getXPos() ? sourceObj.getXPos() - parentObj.getXPos() : parentObj.getXPos() - sourceObj.getXPos(); // 议葛搅谛 跨蝶搅谛暧 剪葬离
local y = parentObj.getYPos() - sourceObj.getYPos();
if(sourceObj.getDirection() == parentObj.getDirection())
x = -x;
sq_SendCreatePassiveObjectPacket(sourceObj, 21035, 0, x, y, 0, ENUM_DIRECTION_NEUTRAL);
}
appendage.setValid(false);
}
}