Commit 642d9aa9 authored by salix5's avatar salix5
parent b6d4fb38
......@@ -300,7 +300,7 @@ uint32 card::get_type() {
return type;
}
int32 card::get_base_attack(uint8 swap) {
if (current.location != LOCATION_MZONE && data.type & (TYPE_SPELL + TYPE_TRAP))
if (current.location != LOCATION_MZONE && !(data.type & TYPE_MONSTER))
return 0;
if (current.location != LOCATION_MZONE)
return data.attack;
......@@ -328,7 +328,7 @@ int32 card::get_base_attack(uint8 swap) {
int32 card::get_attack(uint8 swap) {
if(assume_type == ASSUME_ATTACK)
return assume_value;
if (current.location != LOCATION_MZONE && data.type & (TYPE_SPELL + TYPE_TRAP))
if (current.location != LOCATION_MZONE && !(data.type & TYPE_MONSTER))
return 0;
if (current.location != LOCATION_MZONE)
return data.attack;
......@@ -400,7 +400,7 @@ int32 card::get_attack(uint8 swap) {
return atk;
}
int32 card::get_base_defence(uint8 swap) {
if (current.location != LOCATION_MZONE && data.type & (TYPE_SPELL + TYPE_TRAP))
if (current.location != LOCATION_MZONE && !(data.type & TYPE_MONSTER))
return 0;
if (current.location != LOCATION_MZONE)
return data.defence;
......@@ -428,7 +428,7 @@ int32 card::get_base_defence(uint8 swap) {
int32 card::get_defence(uint8 swap) {
if(assume_type == ASSUME_DEFENCE)
return assume_value;
if (current.location != LOCATION_MZONE && data.type & (TYPE_SPELL + TYPE_TRAP))
if (current.location != LOCATION_MZONE && !(data.type & TYPE_MONSTER))
return 0;
if (current.location != LOCATION_MZONE)
return data.defence;
......@@ -500,7 +500,7 @@ int32 card::get_defence(uint8 swap) {
return def;
}
uint32 card::get_level() {
if((data.type & TYPE_XYZ) || (status & STATUS_NO_LEVEL))
if((data.type & TYPE_XYZ) || (status & STATUS_NO_LEVEL) || (current.location != LOCATION_MZONE && !(data.type & TYPE_MONSTER)))
return 0;
if(assume_type == ASSUME_LEVEL)
return assume_value;
......@@ -610,7 +610,7 @@ uint32 card::check_xyz_level(card* pcard, uint32 lv) {
uint32 card::get_attribute() {
if(assume_type == ASSUME_ATTRIBUTE)
return assume_value;
if(current.location != LOCATION_MZONE && data.type & (TYPE_SPELL + TYPE_TRAP))
if(current.location != LOCATION_MZONE && !(data.type & TYPE_MONSTER))
return 0;
if(!(current.location & (LOCATION_MZONE + LOCATION_GRAVE)))
return data.attribute;
......@@ -637,7 +637,7 @@ uint32 card::get_attribute() {
uint32 card::get_race() {
if(assume_type == ASSUME_RACE)
return assume_value;
if(current.location != LOCATION_MZONE && data.type & (TYPE_SPELL + TYPE_TRAP))
if(current.location != LOCATION_MZONE && !(data.type & TYPE_MONSTER))
return 0;
if(!(current.location & (LOCATION_MZONE + LOCATION_GRAVE)))
return data.race;
......
......@@ -22,11 +22,35 @@ function c164710.lvcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c164710.lvop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetTargetRange(LOCATION_HAND,LOCATION_HAND)
e1:SetValue(-1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local c=e:GetHandler()
local hg=Duel.GetFieldGroup(tp,LOCATION_HAND,LOCATION_HAND):Filter(Card.IsLevelAbove,nil,1)
local tc=hg:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(-1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=hg:GetNext()
end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_HAND)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetOperation(c164710.hlvop)
Duel.RegisterEffect(e2,tp)
end
function c164710.hlvop(e,tp,eg,ep,ev,re,r,rp)
local hg=eg:Filter(Card.IsLevelAbove,nil,1)
local tc=hg:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(-1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=hg:GetNext()
end
end
......@@ -13,11 +13,38 @@ function c23265313.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c23265313.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetValue(-2)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local c=e:GetHandler()
local hg=Duel.GetFieldGroup(tp,LOCATION_HAND,0):Filter(Card.IsLevelAbove,nil,1)
local tc=hg:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(-2)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=hg:GetNext()
end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_HAND)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetOperation(c23265313.hlvop)
Duel.RegisterEffect(e2,tp)
end
function c23265313.hlvfilter(c,tp)
return c:IsLevelAbove(1) and c:IsControler(tp)
end
function c23265313.hlvop(e,tp,eg,ep,ev,re,r,rp)
local hg=eg:Filter(c23265313.hlvfilter,nil,tp)
local tc=hg:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(-2)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=hg:GetNext()
end
end
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