Commit 1ad1b5fc authored by argon.sun's avatar argon.sun

fix

parent fc5791c2
......@@ -108,10 +108,16 @@ void ClientCard::UpdateInfo(char* buf) {
is_public = BufferIO::ReadInt32(buf);
}
void ClientCard::ClearTarget() {
for(auto cit = cardTarget.begin(); cit != cardTarget.end(); ++cit)
for(auto cit = cardTarget.begin(); cit != cardTarget.end(); ++cit) {
if(is_showtarget)
(*cit)->is_showtarget = false;
(*cit)->ownerTarget.erase(this);
for(auto cit = ownerTarget.begin(); cit != ownerTarget.end(); ++cit)
}
for(auto cit = ownerTarget.begin(); cit != ownerTarget.end(); ++cit) {
if(is_showtarget)
(*cit)->is_showtarget = false;
(*cit)->cardTarget.erase(this);
}
cardTarget.clear();
ownerTarget.clear();
}
......
......@@ -1793,6 +1793,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if(cl != pl) {
pcard->ClearTarget();
if(pcard->equipTarget) {
pcard->equipTarget->is_showequip = false;
pcard->equipTarget->equipped.erase(pcard);
pcard->equipTarget = 0;
}
......
......@@ -61,6 +61,7 @@ int ReplayMode::ReplayThread(void* param) {
cur_replay.ReadData(mainGame->dInfo.hostname_tag, 40);
cur_replay.ReadData(mainGame->dInfo.clientname_tag, 40);
cur_replay.ReadData(mainGame->dInfo.clientname, 40);
mainGame->dInfo.is_tag = true;
} else {
cur_replay.ReadData(mainGame->dInfo.hostname, 40);
cur_replay.ReadData(mainGame->dInfo.clientname, 40);
......
......@@ -111,6 +111,7 @@ static const struct luaL_Reg cardlib[] = {
{ "ReleaseRelation", scriptlib::card_release_relation },
{ "CreateEffectRelation", scriptlib::card_create_effect_relation },
{ "ReleaseEffectRelation", scriptlib::card_release_effect_relation },
{ "ClearEffectRelation", scriptlib::card_clear_effect_relation },
{ "IsRelateToEffect", scriptlib::card_is_relate_to_effect },
{ "IsRelateToCard", scriptlib::card_is_relate_to_card },
{ "IsRelateToBattle", scriptlib::card_is_relate_to_battle },
......
......@@ -870,6 +870,13 @@ int32 scriptlib::card_release_effect_relation(lua_State *L) {
pcard->relate_effect.erase(peffect);
return 0;
}
int32 scriptlib::card_clear_effect_relation(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
pcard->relate_effect.clear();
return 0;
}
int32 scriptlib::card_is_relate_to_effect(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
......
......@@ -444,6 +444,10 @@ int32 field::damage(uint16 step, effect* reason_effect, uint32 reason, uint8 rea
pduel->write_buffer32(val);
core.units.begin()->arg2 = (core.units.begin()->arg2 & 0xff000000) + (val & 0xffffff);
raise_event(reason_card, EVENT_DAMAGE, reason_effect, reason, reason_player, playerid, val);
if(reason == REASON_BATTLE && reason_card) {
raise_single_event(reason_card, 0, EVENT_BATTLE_DAMAGE, 0, 0, reason_player, playerid, val);
raise_event(reason_card, EVENT_BATTLE_DAMAGE, 0, 0, reason_player, playerid, val);
}
process_instant_event();
return FALSE;
}
......
......@@ -3210,16 +3210,10 @@ int32 field::process_battle_command(uint16 step) {
reason_card = core.attack_target;
effect* damchange = core.units.begin()->peffect;
if(!damchange) {
if(core.battle_damage[0]) {
if(core.battle_damage[0])
damage(0, REASON_BATTLE, reason_player, reason_card, 0, core.battle_damage[0]);
raise_single_event(reason_card, 0, EVENT_BATTLE_DAMAGE, 0, 0, reason_player, 0, core.battle_damage[0]);
raise_event(reason_card, EVENT_BATTLE_DAMAGE, 0, 0, reason_player, 0, core.battle_damage[0]);
}
if(core.battle_damage[1]) {
if(core.battle_damage[1])
damage(0, REASON_BATTLE, reason_player, reason_card, 1, core.battle_damage[1]);
raise_single_event(reason_card, 0, EVENT_BATTLE_DAMAGE, 0, 0, reason_player, 1, core.battle_damage[1]);
raise_event(reason_card, EVENT_BATTLE_DAMAGE, 0, 0, reason_player, 1, core.battle_damage[1]);
}
} else {
if(core.battle_damage[0])
damage(damchange, REASON_EFFECT, reason_player, reason_card, 0, core.battle_damage[0]);
......
......@@ -113,6 +113,7 @@ public:
static int32 card_release_relation(lua_State *L);
static int32 card_create_effect_relation(lua_State *L);
static int32 card_release_effect_relation(lua_State *L);
static int32 card_clear_effect_relation(lua_State *L);
static int32 card_is_relate_to_effect(lua_State *L);
static int32 card_is_relate_to_card(lua_State *L);
static int32 card_is_relate_to_battle(lua_State *L);
......
......@@ -21,7 +21,7 @@ function c14644902.filter(c,e,tp)
end
function c14644902.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rg=Duel.SelectReleaseGroup(tp,c14644902.rfilter,1,1,nil,e)
local rg=Duel.SelectReleaseGroup(tp,c14644902.rfilter,1,1,e:GetHandler(),e)
if Duel.Release(rg,REASON_EFFECT)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c14644902.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
......
......@@ -23,7 +23,7 @@ function c15574615.initial_effect(c)
c:RegisterEffect(e2)
end
function c15574615.spfilter(c,code)
return c:IsFaceup() and c:IsCode(code) and c:IsAbleToGraveAsCost()
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsCode(code) and c:IsAbleToGraveAsCost()
end
function c15574615.spcon(e,c)
if c==nil then return true end
......
......@@ -44,8 +44,8 @@ function c7165085.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangePosition(tc,POS_FACEUP)
tc:CancelToGrave(false)
tc:CreateEffectRelation(te)
cost(te,tep,eg,ep,ev,re,r,rp,1)
target(te,tep,eg,ep,ev,re,r,rp,1)
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
if target then target(te,tep,eg,ep,ev,re,r,rp,1) end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:GetFirst()
while tg do
......
......@@ -11,12 +11,6 @@ function c76080032.initial_effect(c)
e1:SetTarget(c76080032.eqtg)
e1:SetOperation(c76080032.eqop)
c:RegisterEffect(e1)
--equip effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(1900)
c:RegisterEffect(e2)
--disable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......@@ -76,6 +70,13 @@ function c76080032.eqop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c76080032.eqlimit)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(1900)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
end
function c76080032.discon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
......
......@@ -11,12 +11,6 @@ function c87008374.initial_effect(c)
e1:SetTarget(c87008374.eqtg)
e1:SetOperation(c87008374.eqop)
c:RegisterEffect(e1)
--equip effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(1100)
c:RegisterEffect(e2)
--damage
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(87008374,1))
......@@ -78,6 +72,13 @@ function c87008374.eqop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c87008374.eqlimit)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(1100)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
end
function c87008374.damcon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
......
......@@ -11,6 +11,7 @@ function c88301833.initial_effect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c88301833.thcon)
e2:SetTarget(c88301833.thtg)
......@@ -25,7 +26,7 @@ function c88301833.thfilter(c,tp)
end
function c88301833.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tc=eg:GetFirst()
local mat=tc:GetMaterial()i
local mat=tc:GetMaterial()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and mat:IsContains(chkc) end
if chk==0 then return mat:IsExists(c88301833.thfilter,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
......
......@@ -19,13 +19,15 @@ function c9720537.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,LOCATION_MZONE)
local tc=g:GetFirst()
while tc do
tc:ResetEffect(EFFECT_SET_CONTROL,RESET_CODE)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_CONTROL)
e1:SetValue(tc:GetOwner())
e1:SetReset(RESET_EVENT+0xec0000)
tc:RegisterEffect(e1)
if not tc:IsImmuneToEffect(e) then
tc:ResetEffect(EFFECT_SET_CONTROL,RESET_CODE)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_CONTROL)
e1:SetValue(tc:GetOwner())
e1:SetReset(RESET_EVENT+0xec0000)
tc:RegisterEffect(e1)
end
tc=g:GetNext()
end
end
......@@ -3,9 +3,9 @@
use_d3d = 0
antialias = 2
errorlog = 1
nickname = Player1
nickname = Player
gamename = Game
lastdeck = test
lastdeck = sample
textfont = c:/windows/fonts/simsun.ttc 14
numfont = c:/windows/fonts/arialbd.ttf
serverport = 7911
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment