Commit ed2712c6 authored by nanahira's avatar nanahira

Merge branch 'master' of github.com:Fluorohydride/ygopro-scripts

parents b59a16ae ef6c96a7
...@@ -25,17 +25,17 @@ function s.initial_effect(c) ...@@ -25,17 +25,17 @@ function s.initial_effect(c)
--workaround --workaround
if not aux.rit_mat_hack_check then if not aux.rit_mat_hack_check then
aux.rit_mat_hack_check=true aux.rit_mat_hack_check=true
function aux.rit_mat_hack_exmat_filter(c) function aux.rit_mat_hack_exmat_filter(tc)
return c:IsHasEffect(EFFECT_EXTRA_RITUAL_MATERIAL,c:GetControler()) and c:IsLocation(LOCATION_EXTRA) return tc:IsHasEffect(EFFECT_EXTRA_RITUAL_MATERIAL,tc:GetControler()) and tc:IsLocation(LOCATION_EXTRA)
end end
function aux.RitualCheckGreater(g,c,lv) function aux.RitualCheckGreater(g,rc,lv)
if g:FilterCount(aux.rit_mat_hack_exmat_filter,nil)>1 then return false end if g:FilterCount(aux.rit_mat_hack_exmat_filter,nil)>1 then return false end
Duel.SetSelectedCard(g) Duel.SetSelectedCard(g)
return g:CheckWithSumGreater(Card.GetRitualLevel,lv,c) return g:CheckWithSumGreater(Card.GetRitualLevel,lv,rc)
end end
function aux.RitualCheckEqual(g,c,lv) function aux.RitualCheckEqual(g,rc,lv)
if g:FilterCount(aux.rit_mat_hack_exmat_filter,nil)>1 then return false end if g:FilterCount(aux.rit_mat_hack_exmat_filter,nil)>1 then return false end
return g:CheckWithSumEqual(Card.GetRitualLevel,lv,#g,#g,c) return g:CheckWithSumEqual(Card.GetRitualLevel,lv,#g,#g,rc)
end end
_ReleaseRitualMaterial=Duel.ReleaseRitualMaterial _ReleaseRitualMaterial=Duel.ReleaseRitualMaterial
function Duel.ReleaseRitualMaterial(mat) function Duel.ReleaseRitualMaterial(mat)
......
...@@ -30,7 +30,7 @@ function c98301564.initial_effect(c) ...@@ -30,7 +30,7 @@ function c98301564.initial_effect(c)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c98301564.costchange(e,re,rp,val) function c98301564.costchange(e,re,rp,val)
if re and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsType(TYPE_TRAP) and re:GetHandler():IsType(TYPE_COUNTER) then if re and (re:IsHasType(EFFECT_TYPE_ACTIVATE) or re:GetCode()==EFFECT_TRAP_ACT_IN_HAND or re:GetCode()==EFFECT_TRAP_ACT_IN_SET_TURN) and re:GetHandler():IsType(TYPE_TRAP) and re:GetHandler():IsType(TYPE_COUNTER) then
return 0 return 0
else else
return val return val
......
...@@ -1733,13 +1733,29 @@ function Auxiliary.AddRitualProcUltimate(c,filter,level_function,greater_or_equa ...@@ -1733,13 +1733,29 @@ function Auxiliary.AddRitualProcUltimate(c,filter,level_function,greater_or_equa
end end
return e1 return e1
end end
---@param g Group
---@param c Card
---@param lv integer
---@return boolean
function Auxiliary.RitualCheckGreater(g,c,lv) function Auxiliary.RitualCheckGreater(g,c,lv)
Duel.SetSelectedCard(g) Duel.SetSelectedCard(g)
return g:CheckWithSumGreater(Card.GetRitualLevel,lv,c) return g:CheckWithSumGreater(Card.GetRitualLevel,lv,c)
end end
---@param g Group
---@param c Card
---@param lv integer
---@return boolean
function Auxiliary.RitualCheckEqual(g,c,lv) function Auxiliary.RitualCheckEqual(g,c,lv)
return g:CheckWithSumEqual(Card.GetRitualLevel,lv,#g,#g,c) return g:CheckWithSumEqual(Card.GetRitualLevel,lv,#g,#g,c)
end end
---@param g Group
---@param tp integer
---@param c Card
---@param lv integer
---@param greater_or_equal string
---|"'Greater'"
---|"'Equal'"
---@return boolean
function Auxiliary.RitualCheck(g,tp,c,lv,greater_or_equal) function Auxiliary.RitualCheck(g,tp,c,lv,greater_or_equal)
return Auxiliary["RitualCheck"..greater_or_equal](g,c,lv) and Duel.GetMZoneCount(tp,g,tp)>0 and (not c.mat_group_check or c.mat_group_check(g,tp)) return Auxiliary["RitualCheck"..greater_or_equal](g,c,lv) and Duel.GetMZoneCount(tp,g,tp)>0 and (not c.mat_group_check or c.mat_group_check(g,tp))
and (not Auxiliary.RCheckAdditional or Auxiliary.RCheckAdditional(tp,g,c)) and (not Auxiliary.RCheckAdditional or Auxiliary.RCheckAdditional(tp,g,c))
......
...@@ -147,7 +147,7 @@ end ...@@ -147,7 +147,7 @@ end
---Return value starts from 1, different from Duel.SelectOption ---Return value starts from 1, different from Duel.SelectOption
---@param tp integer ---@param tp integer
---@param ... table {condition, option[, value]} ---@param ... table {condition, option[, value]}
---@return integer ---@return integer|nil
function Auxiliary.SelectFromOptions(tp,...) function Auxiliary.SelectFromOptions(tp,...)
local options={...} local options={...}
local ops={} local ops={}
...@@ -1105,7 +1105,7 @@ end ...@@ -1105,7 +1105,7 @@ end
---@param min? integer ---@param min? integer
---@param max? integer ---@param max? integer
---@param ... any ---@param ... any
---@return Group ---@return Group|nil
function Group.SelectSubGroup(g,tp,f,cancelable,min,max,...) function Group.SelectSubGroup(g,tp,f,cancelable,min,max,...)
Auxiliary.SubGroupCaptured=Group.CreateGroup() Auxiliary.SubGroupCaptured=Group.CreateGroup()
min=min or 1 min=min or 1
...@@ -1203,7 +1203,7 @@ end ...@@ -1203,7 +1203,7 @@ end
---@param cancelable? boolean ---@param cancelable? boolean
---@param f? function ---@param f? function
---@param ... any ---@param ... any
---@return Group ---@return Group|nil
function Group.SelectSubGroupEach(g,tp,checks,cancelable,f,...) function Group.SelectSubGroupEach(g,tp,checks,cancelable,f,...)
if cancelable==nil then cancelable=false end if cancelable==nil then cancelable=false end
if f==nil then f=Auxiliary.TRUE end if f==nil then f=Auxiliary.TRUE 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