Commit f95d9084 authored by nekrozar's avatar nekrozar

update EVENT_SSET

for Altergeist Haunted Rock.
parent b94f0ed9
...@@ -560,8 +560,8 @@ public: ...@@ -560,8 +560,8 @@ public:
int32 summon(uint16 step, uint8 sumplayer, card* target, effect* proc, uint8 ignore_count, uint8 min_tribute, uint32 zone); int32 summon(uint16 step, uint8 sumplayer, card* target, effect* proc, uint8 ignore_count, uint8 min_tribute, uint32 zone);
int32 flip_summon(uint16 step, uint8 sumplayer, card* target); int32 flip_summon(uint16 step, uint8 sumplayer, card* target);
int32 mset(uint16 step, uint8 setplayer, card* ptarget, effect* proc, uint8 ignore_count, uint8 min_tribute, uint32 zone); int32 mset(uint16 step, uint8 setplayer, card* ptarget, effect* proc, uint8 ignore_count, uint8 min_tribute, uint32 zone);
int32 sset(uint16 step, uint8 setplayer, uint8 toplayer, card* ptarget); int32 sset(uint16 step, uint8 setplayer, uint8 toplayer, card* ptarget, effect* reason_effect);
int32 sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget, uint8 confirm); int32 sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget, uint8 confirm, effect* reason_effect);
int32 special_summon_rule(uint16 step, uint8 sumplayer, card* target, uint32 summon_type); int32 special_summon_rule(uint16 step, uint8 sumplayer, card* target, uint32 summon_type);
int32 special_summon_step(uint16 step, group* targets, card* target, uint32 zone); int32 special_summon_step(uint16 step, group* targets, card* target, uint32 zone);
int32 special_summon(uint16 step, effect* reason_effect, uint8 reason_player, group* targets, uint32 zone); int32 special_summon(uint16 step, effect* reason_effect, uint8 reason_player, group* targets, uint32 zone);
......
...@@ -399,9 +399,9 @@ int32 scriptlib::duel_sets(lua_State *L) { ...@@ -399,9 +399,9 @@ int32 scriptlib::duel_sets(lua_State *L) {
} else } else
luaL_error(L, "Parameter %d should be \"Card\" or \"Group\".", 2); luaL_error(L, "Parameter %d should be \"Card\" or \"Group\".", 2);
if(pcard) if(pcard)
pduel->game_field->add_process(PROCESSOR_SSET, 0, 0, (group*)pcard, playerid, toplayer); pduel->game_field->add_process(PROCESSOR_SSET, 0, pduel->game_field->core.reason_effect, (group*)pcard, playerid, toplayer);
else else
pduel->game_field->add_process(PROCESSOR_SSET_G, 0, 0, pgroup, playerid, toplayer, confirm); pduel->game_field->add_process(PROCESSOR_SSET_G, 0, pduel->game_field->core.reason_effect, pgroup, playerid, toplayer, confirm);
return lua_yield(L, 0); return lua_yield(L, 0);
} }
int32 scriptlib::duel_create_token(lua_State *L) { int32 scriptlib::duel_create_token(lua_State *L) {
......
...@@ -2276,7 +2276,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card* target, effect* proc, uint ...@@ -2276,7 +2276,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card* target, effect* proc, uint
} }
return TRUE; return TRUE;
} }
int32 field::sset(uint16 step, uint8 setplayer, uint8 toplayer, card * target) { int32 field::sset(uint16 step, uint8 setplayer, uint8 toplayer, card * target, effect* reason_effect) {
switch(step) { switch(step) {
case 0: { case 0: {
if(!(target->data.type & TYPE_FIELD) && get_useable_count(target, toplayer, LOCATION_SZONE, setplayer, LOCATION_REASON_TOFIELD) <= 0) if(!(target->data.type & TYPE_FIELD) && get_useable_count(target, toplayer, LOCATION_SZONE, setplayer, LOCATION_REASON_TOFIELD) <= 0)
...@@ -2322,7 +2322,7 @@ int32 field::sset(uint16 step, uint8 setplayer, uint8 toplayer, card * target) { ...@@ -2322,7 +2322,7 @@ int32 field::sset(uint16 step, uint8 setplayer, uint8 toplayer, card * target) {
pduel->write_buffer32(target->data.code); pduel->write_buffer32(target->data.code);
pduel->write_buffer32(target->get_info_location()); pduel->write_buffer32(target->get_info_location());
adjust_instant(); adjust_instant();
raise_event(target, EVENT_SSET, 0, 0, setplayer, setplayer, 0); raise_event(target, EVENT_SSET, reason_effect, 0, setplayer, setplayer, 0);
process_instant_event(); process_instant_event();
if(core.current_chain.size() == 0) { if(core.current_chain.size() == 0) {
adjust_all(); adjust_all();
...@@ -2333,7 +2333,7 @@ int32 field::sset(uint16 step, uint8 setplayer, uint8 toplayer, card * target) { ...@@ -2333,7 +2333,7 @@ int32 field::sset(uint16 step, uint8 setplayer, uint8 toplayer, card * target) {
} }
return TRUE; return TRUE;
} }
int32 field::sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget, uint8 confirm) { int32 field::sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget, uint8 confirm, effect* reason_effect) {
switch(step) { switch(step) {
case 0: { case 0: {
card_set* set_cards = new card_set; card_set* set_cards = new card_set;
...@@ -2490,7 +2490,7 @@ int32 field::sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget ...@@ -2490,7 +2490,7 @@ int32 field::sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget
case 7: { case 7: {
returns.ivalue[0] = core.operated_set.size(); returns.ivalue[0] = core.operated_set.size();
adjust_instant(); adjust_instant();
raise_event(&core.operated_set, EVENT_SSET, 0, 0, setplayer, setplayer, 0); raise_event(&core.operated_set, EVENT_SSET, reason_effect, 0, setplayer, setplayer, 0);
process_instant_event(); process_instant_event();
if(core.current_chain.size() == 0) { if(core.current_chain.size() == 0) {
adjust_all(); adjust_all();
......
...@@ -395,7 +395,7 @@ int32 field::process() { ...@@ -395,7 +395,7 @@ int32 field::process() {
return pduel->bufferlen; return pduel->bufferlen;
} }
case PROCESSOR_SSET: { case PROCESSOR_SSET: {
if (sset(it->step, it->arg1, it->arg2, (card*)(it->ptarget))) if (sset(it->step, it->arg1, it->arg2, (card*)(it->ptarget), it->peffect))
core.units.pop_front(); core.units.pop_front();
else else
it->step++; it->step++;
...@@ -409,7 +409,7 @@ int32 field::process() { ...@@ -409,7 +409,7 @@ int32 field::process() {
return pduel->bufferlen; return pduel->bufferlen;
} }
case PROCESSOR_SSET_G: { case PROCESSOR_SSET_G: {
if (sset_g(it->step, it->arg1, it->arg2, it->ptarget, it->arg3)) { if (sset_g(it->step, it->arg1, it->arg2, it->ptarget, it->arg3, it->peffect)) {
pduel->lua->add_param(returns.ivalue[0], PARAM_TYPE_INT); pduel->lua->add_param(returns.ivalue[0], PARAM_TYPE_INT);
core.units.pop_front(); core.units.pop_front();
} else } else
......
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