Commit 4d72fdb3 authored by nanahira's avatar nanahira

Merge branch 'develop' of github.com:moecube/ygopro-core into develop

parents dcb3ee6c a6e26326
......@@ -1664,7 +1664,6 @@ uint32 card::get_select_info_location(uint8 *deck_seq_pointer) {
int32 card::is_treated_as_not_on_field() {
return get_status(STATUS_SUMMONING | STATUS_SUMMON_DISABLED | STATUS_ACTIVATE_DISABLED | STATUS_SPSUMMON_STEP);
}
void card::equip(card* target, uint32 send_msg) {
if (equiping_target)
return;
......
......@@ -279,9 +279,9 @@ public:
uint32 get_column_zone(int32 location);
void get_column_cards(card_set* cset);
int32 is_all_column();
int32 is_treated_as_not_on_field();
uint8 get_select_sequence(uint8 *deck_seq_pointer);
uint32 get_select_info_location(uint8 *deck_seq_pointer);
int32 is_treated_as_not_on_field();
void equip(card* target, uint32 send_msg = TRUE);
void unequip();
......
......@@ -14,7 +14,7 @@
#include "group.h"
#include "ocgapi.h"
inline void write_buffer_vector(std::vector<byte>& buffer, const void*& data, int size) {
inline void write_buffer_vector(std::vector<byte>& buffer, const void* data, int size) {
if (size > 0) {
const auto len = buffer.size();
buffer.resize(len + size);
......
......@@ -221,7 +221,8 @@ int32 effect::get_required_handorset_effects(effect_set* eset, uint8 playerid, c
pduel->lua->add_param(e.reason, PARAM_TYPE_INT);
pduel->lua->add_param(e.reason_player, PARAM_TYPE_INT);
pduel->lua->add_param(0, PARAM_TYPE_INT);
if(pduel->lua->check_condition(peffect->cost, 9)) {
pduel->lua->add_param(this, PARAM_TYPE_EFFECT);
if(pduel->lua->check_condition(peffect->cost, 10)) {
available = 2;
eset->add_item(peffect);
}
......
......@@ -8,13 +8,9 @@
#ifndef INTERPRETER_H_
#define INTERPRETER_H_
#ifdef _IRR_ANDROID_PLATFORM_
#include "lua.hpp"
#else
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
#endif
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
#include "common.h"
#include <unordered_map>
#include <list>
......
......@@ -3962,7 +3962,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
uint8 dest = pcard->sendto_param.location;
if(!(reason & REASON_RULE) &&
(pcard->get_status(STATUS_SUMMONING | STATUS_SPSUMMON_STEP)
|| (!(pcard->current.reason & (REASON_COST | REASON_SUMMON | REASONS_PROCEDURE)) && !pcard->is_affect_by_effect(pcard->current.reason_effect))
|| ((pcard->current.reason & REASON_EFFECT) && !pcard->is_affect_by_effect(pcard->current.reason_effect))
|| (dest == LOCATION_HAND && !pcard->is_capable_send_to_hand(core.reason_player))
|| (dest == LOCATION_DECK && !pcard->is_capable_send_to_deck(core.reason_player, send_activating))
|| (dest == LOCATION_REMOVED && !pcard->is_removeable(core.reason_player, pcard->sendto_param.position, reason))
......@@ -3982,6 +3982,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
return FALSE;
}
case 1: {
// the entrance of release, destroy
for(auto& pcard : targets->container) {
add_process(PROCESSOR_SENDTO_REPLACE, 0, nullptr, targets, 0, 0, 0, 0, pcard);
}
......
......@@ -4168,6 +4168,30 @@ int32 field::add_chain(uint16 step) {
if(clit.required_handorset_effects.size() == 1) {
returns.ivalue[0] = 0;
return FALSE;
} else {
// check if there's only one type of ceffects
auto peffect = clit.triggering_effect;
auto playerid = clit.triggering_player;
int32 ceffect_unique_id = 0;
for(int32 i = 0; i < clit.required_handorset_effects.size(); ++i) {
pduel->lua->add_param(peffect, PARAM_TYPE_EFFECT);
pduel->lua->add_param(playerid, PARAM_TYPE_INT);
auto id = clit.required_handorset_effects[i]->get_value(2);
if (id) {
if(!ceffect_unique_id) {
ceffect_unique_id = id;
} else if (ceffect_unique_id != id) {
// there are more than one types, so we can't skip
ceffect_unique_id = 0;
break;
}
}
}
if (ceffect_unique_id) {
// all ceffects are the same type, so skip asking
returns.ivalue[0] = 0;
return FALSE;
}
}
core.select_options.clear();
for(int32 i = 0; i < clit.required_handorset_effects.size(); ++i) {
......@@ -4187,6 +4211,7 @@ int32 field::add_chain(uint16 step) {
pduel->write_buffer32(ceffect->description);
}
if(ceffect->cost) {
pduel->lua->add_param(clit.triggering_effect, PARAM_TYPE_EFFECT);
core.sub_solving_event.push_back(clit.evt);
add_process(PROCESSOR_EXECUTE_COST, 0, ceffect, 0, clit.triggering_player, 0);
}
......
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