Skip to content

Commit

Permalink
Revert! OOPS
Browse files Browse the repository at this point in the history
  • Loading branch information
Moligaloo committed Oct 12, 2011
1 parent 849a30f commit cba0caf
Show file tree
Hide file tree
Showing 23 changed files with 74 additions and 453 deletions.
1 change: 0 additions & 1 deletion QSanguosha
Submodule QSanguosha deleted from 9f0a50
2 changes: 1 addition & 1 deletion QSanguosha.pro
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ SOURCES += src/main.cpp \
src/util/detector.cpp \
src/util/nativesocket.cpp \
src/util/recorder.cpp \
swig/sanguosha_wrap.cxx
swig/sanguosha_wrap.cxx \

HEADERS += src/client/aux-skills.h \
src/client/client.h \
Expand Down
Binary file removed audio/death/LESxiahoujuan.ogg
Binary file not shown.
Binary file removed audio/skill/LesbianLianli.ogg
Binary file not shown.
Binary file removed image/generals/big/LESxiahoujuan.png
Binary file not shown.
Binary file removed image/generals/big/guandu-zhangliao.png
Binary file not shown.
Binary file removed image/generals/card/LESxiahoujuan.jpg
Binary file not shown.
Binary file removed image/generals/card/guandu-zhangliao.jpg
Binary file not shown.
Binary file removed image/generals/small/LESxiahoujuan.png
Binary file not shown.
Binary file removed image/generals/small/guandu-zhangliao.png
Binary file not shown.
Binary file removed image/generals/tiny/LESxiahoujuan.png
Binary file not shown.
Binary file removed image/generals/tiny/guandu-zhangliao.png
Binary file not shown.
22 changes: 3 additions & 19 deletions lang/zh_CN/GuanduScenario.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,10 @@

return {
["guandu"] = "官渡之战",

["guandu-zhangliao"] = "张辽(官渡)",
["smalltuxi"] = "小突袭",
["smalltuxi"] = "小突袭",
["zhanshuangxiong"] = "斩颜良诛文丑",
["greatyiji"] = "遗计定辽东",
[":smalltuxi"] = "摸牌阶段,你可以放弃摸牌,从一名其他角色手里抽一张牌",

["zhanshuangxiong"] = "斩颜良诛文丑",
[":zhanshuangxiong"] = "每回合可选择与颜良文丑拼点一次,落败的一方将损失一点体力",

["greatyiji"] = "遗计定辽东",
[":greatyiji"] = "每回合的出牌阶段之前强制自损一血,同时遗计可摸三张牌,直到自己阵亡为止",

["#Guandu_ZhanShuangxiong"] = "颜良正在麾盖下,见关公冲来,方欲问时,关公赤兔马快,早已跑到面前;\
颜良措手不及,被云长手起一刀,刺于马下。关公马快,赶上文丑,脑后一刀,将文丑斩下马来。— 三国演义第25回\
剧情【斩颜良诛文丑】被触发",
["#Guandu_Caojunqueliang"] = "攸曰:“公今军粮尚有几何?”……攸大声曰:“休瞒我!粮已尽矣!” — 三国演义第30回\
剧情【曹军缺粮】被触发,曹操、郭嘉、张辽、关羽每回合摸牌阶段将少摸一张牌,张辽只能突袭一个人的一张牌。",
["#Guandu_BurnWuchao"] = "操教军士将束草周围举火,众将校鼓噪直入。……二将抵敌不住,皆被曹军所杀,粮草尽行烧绝。— 三国演义第30回\
袁绍受到曹军的火焰伤害,剧情【火烧乌巢】被触发\n\
曹军不再受缺粮的制约,从牌堆顶取出四张黑色的装备或基本牌分别横放在袁绍、颜良文丑、甄姬、刘备面前,视同兵粮寸断。",
["#Guandu_Yijidingliaodong"] = "操遂出郭嘉书以示之。书略曰:“ 今闻袁熙、袁尚往投辽东,明公切不可加兵。\
公孙康久畏袁氏吞并,二袁往投必疑。若以兵击之,必并力迎敌,急不可下;若缓之,公孙康、袁氏必自相图,其势然也。”众皆踊跃称善。— 三国演义第33回\
斩颜良诛文丑和火烧乌巢的剧情都已经发生,剧情【遗计定辽东】被触发,郭嘉在每回合的出牌阶段之前须强制自损一血,同时遗计可摸三张牌",
}
19 changes: 0 additions & 19 deletions lang/zh_CN/HongyanScenario.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,4 @@ return {
["hongyan_lesbian"] = "红颜百合赛",
["lesbianlijian"] = "百合离间",
["lesbianjieyin"] = "百合结姻",

["LESxiahoujuan"] = "夏侯涓(百合)",
["LesbianLianli"] = "百合连理",
[":LesbianLianli"] = "回合开始阶段,你可以选择一名女性角色,你和其进入连理状态直到你的下回合开始:该角色可以帮你出闪,你可以帮其出杀。",

["$LesbianLianli"] = "连理并蒂,比翼不疑",
["~LESxiahoujuan"] = "行与子逝兮,归于其室",

["LesbianLianli-slash"] = "连理(杀)",
["LesbianLianli-jink"] = "连理(闪)",
["@LesbianLianli-slash"] = "请提供一张杀给你的连理对象",
["@LesbianLianli-jink"] = "请提供一张闪给你的连理对象",

["@@LesbianLianli-card"] = "请选择一名要连理的对象",
["#LesbianLianliConnection"] = "%from 与 %to 结为连理",
["@tied"] = "连理",

["cv:LESxiahoujuan"] = "妙妙",
["designer:LESxiahoujuan"] = "宇文天启,艾艾艾",
}
41 changes: 41 additions & 0 deletions lua/ai/fire-ai.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,47 @@ function pangtong_ai:activate_dummy(use)
super.activate(self, use)
end

--luanji
local yuanshao_ai = SmartAI:newSubclass "yuanshao"
function yuanshao_ai:activate(use)

local first_found, second_found = false, false
local first_card, second_card
if self.player:getHandcardNum() >= 2 then
local cards = self.player:getHandcards()
local same_suit=false
cards = sgs.QList2Table(cards)
for _, fcard in ipairs(cards) do
if not (fcard:inherits("Peach") or fcard:inherits("ExNihilo")) then
first_card = fcard
first_found = true
for _, scard in ipairs(cards) do
if first_card ~= scard and scard:getSuitString() == first_card:getSuitString() and not (scard:inherits("Peach") or scard:inherits("ExNihilo")) then
second_card = scard
second_found = true
break
end
end
if second_card then break end
end
end
end

if first_found and second_found then

local luanji_card = {}
local first_suit, first_number, first_id = first_card:getSuitString(), first_card:getNumberString(), first_card:getId()
local second_suit, second_number, second_id = second_card:getSuitString(), second_card:getNumberString(), second_card:getId()
local card_str = ("archery_attack:luanji[%s:%s]=%d+%d"):format(first_suit, first_number, first_id, second_id)
local archeryattack = sgs.Card_Parse(card_str)
assert(archeryattack)
self:useTrickCard(archeryattack, use)
return
end

super.activate(self, use)
end

local xunyu_ai = SmartAI:newSubclass "xunyu"

function xunyu_ai:activate(use)
Expand Down
39 changes: 0 additions & 39 deletions lua/ai/fire-skill-ai.lua
Original file line number Diff line number Diff line change
Expand Up @@ -171,43 +171,4 @@ sgs.ai_skill_use_func["TianyiCard"]=function(card,use,self)
break
end
end
end


--luanji
local luanji_skill={}
luanji_skill.name="luanji"
table.insert(sgs.ai_skills,luanji_skill)
luanji_skill.getTurnUseCard=function(self)
local first_found, second_found = false, false
local first_card, second_card
if self.player:getHandcardNum() >= 2 then
local cards = self.player:getHandcards()
local same_suit=false
cards = sgs.QList2Table(cards)
for _, fcard in ipairs(cards) do
if not (fcard:inherits("Peach") or fcard:inherits("ExNihilo")) then
first_card = fcard
first_found = true
for _, scard in ipairs(cards) do
if first_card ~= scard and scard:getSuitString() == first_card:getSuitString() and not (scard:inherits("Peach") or scard:inherits("ExNihilo")) then
second_card = scard
second_found = true
break
end
end
if second_card then break end
end
end
end

if first_found and second_found then
local luanji_card = {}
local first_suit, first_number, first_id = first_card:getSuitString(), first_card:getNumberString(), first_card:getId()
local second_suit, second_number, second_id = second_card:getSuitString(), second_card:getNumberString(), second_card:getId()
local card_str = ("archery_attack:luanji[%s:%s]=%d+%d"):format(first_suit, first_number, first_id, second_id)
local archeryattack = sgs.Card_Parse(card_str)
assert(archeryattack)
return archeryattack
end
end
8 changes: 4 additions & 4 deletions scenarios/hongyan_lesbian.html
Original file line number Diff line number Diff line change
Expand Up @@ -550,14 +550,14 @@ <h1>红颜模式</h1>
<div class="title">初始分配</div>
<div class="content">
<pre><tt>游戏开始时,场上随机分配8位女性武将作为你的武将:
甄姬,夏侯涓,黄月英,祝融,大乔,吴国太,孙尚香,小乔,貂蝉,蔡昭姬,蔡文姬</tt></pre>
甄姬,夏侯涓,黄月英,祝融,大乔,陆逊,孙尚香,小乔,貂蝉,蔡昭姬</tt></pre>
</div></div>
<div class="listingblock">
<div class="title">技能新增</div>
<div class="content">
<pre><tt>百合结姻(孙尚香):出牌阶段,你可以弃两张手牌并指定一名受伤的女性角色:你和目标角色各回复1点体力。每回合限用一次。
百合离间(貂蝉):出牌阶段,你可以弃一张牌并选择两名女性角色(可以指定自己)。若如此做,视为其中一名女性角色对另一名女性角色使用一张【决斗】。额外的,此【决斗】不能被【无懈可击】响应。每回合限用一次。
百合连理(夏侯涓): 回合开始阶段,你可以选择一名女性角色,你和其进入连理状态直到你的下回合开始:该角色可以帮你出闪,你可以帮其出杀。</tt></pre>
<pre><tt>百合结姻:出牌阶段,你可以弃两张手牌并指定一名受伤的女性角色:你和目标角色各回复1点体力。每回合限用一次。
百合离间:出牌阶段,你可以弃一张牌并选择两名女性角色(可以指定自己)。若如此做,视为其中一名女性角色对另一名女性角色使用一张【决斗】。额外的,此【决斗】不能被【无懈可击】响应。每回合限用一次。
百合连理: 回合开始阶段,你可以选择一名女性角色,你和其进入连理状态直到你的下回合开始:该角色可以帮你出闪,你可以帮其出杀。</tt></pre>
</div></div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/dialog/halldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,5 @@ void Client::roomError(const QString &errorStr){
}

QString msg = map.value(errorStr, tr("Unknown room error: %1").arg(errorStr));
QMessageBox::warning(NULL, tr("Warning"), msg);
QMessageBox::warning(HallDialogInstance, tr("Warning"), msg);
}
62 changes: 12 additions & 50 deletions src/scenario/guandu-scenario.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ void ZhanShuangxiongCard::use(Room *room, ServerPlayer *source, const QList<Serv
room->damage(damage);

room->setTag("ZhanShuangxiong", true);

LogMessage log;
log.type = "#Guandu_ZhanShuangxiong";
log.from = source;
source->getRoom()->sendLog(log);
}

class GreatYiji: public MasochismSkill{
Expand Down Expand Up @@ -64,11 +59,6 @@ class DamageBeforePlay: public PhaseChangeSkill{
DamageStruct damage;
damage.to = target;
target->getRoom()->damage(damage);

LogMessage log;
log.type = "#Guandu_Yijidingliaodong";
log.from = target;
target->getRoom()->sendLog(log);
}

return false;
Expand Down Expand Up @@ -134,24 +124,24 @@ class SmallTuxi:public PhaseChangeSkill{
}

virtual bool triggerable(const ServerPlayer *target) const{
return target->getGeneralName() == "guandu-zhangliao"
return target->getGeneralName() == "zhangliao"
&& ! target->getRoom()->getTag("BurnWuchao").toBool();
}

virtual bool onPhaseChange(ServerPlayer *Guandu_zhangliao) const{
if(Guandu_zhangliao->getPhase() == Player::Draw){
Room *room = Guandu_zhangliao->getRoom();
virtual bool onPhaseChange(ServerPlayer *zhangliao) const{
if(zhangliao->getPhase() == Player::Draw){
Room *room = zhangliao->getRoom();
bool can_invoke = false;
QList<ServerPlayer *> other_players = room->getOtherPlayers(Guandu_zhangliao);
QList<ServerPlayer *> other_players = room->getOtherPlayers(zhangliao);
foreach(ServerPlayer *player, other_players){
if(!player->isKongcheng()){
can_invoke = true;
break;
}
}

if(!can_invoke || !room->askForUseCard(Guandu_zhangliao, "@@smalltuxi", "@tuxi-card"))
Guandu_zhangliao->drawCards(1, false);
if(!can_invoke || !room->askForUseCard(zhangliao, "@@smalltuxi", "@tuxi-card"))
zhangliao->drawCards(1, false);

return true;
}
Expand Down Expand Up @@ -189,11 +179,9 @@ class GuanduRule: public ScenarioRule{
room->installEquip(guanyu, "chitu");
room->acquireSkill(guanyu, "zhanshuangxiong");

//ServerPlayer *zhangliao = room->findPlayer("zhangliao");
//room->acquireSkill(zhangliao, "smalltuxi");

ServerPlayer *zhenji = room->findPlayer("zhenji");
room->setPlayerProperty(zhenji, "kingdom", "qun");
ServerPlayer *zhangliao = room->findPlayer("zhangliao");
room->acquireSkill(zhangliao, "smalltuxi");
}

break;
Expand All @@ -205,22 +193,9 @@ class GuanduRule: public ScenarioRule{
if(!burned){
QString name = player->getGeneralName();
if(name == "caocao" || name == "guojia" || name == "guanyu"){

LogMessage log;
log.type = "#Guandu_Caojunqueliang";
log.from = player;
player->getRoom()->sendLog(log);

player->drawCards(1, false);
return true;
}
else if(name == "guandu-zhangliao"){
LogMessage log;
log.type = "#Guandu_Caojunqueliang";
log.from = player;
player->getRoom()->sendLog(log);
return false;
}
}
}

Expand All @@ -233,16 +208,10 @@ class GuanduRule: public ScenarioRule{
return false;

DamageStruct damage = data.value<DamageStruct>();
ServerPlayer *Guandu_zhangliao = room->findPlayer("guandu-zhangliao");
if(player->getGeneralName() == "yuanshao" && damage.nature == DamageStruct::Fire
&& damage.from->getRoleEnum() == Player::Rebel){
room->setTag("BurnWuchao", true);

LogMessage log;
log.type = "#Guandu_BurnWuchao";
log.from = player;
player->getRoom()->sendLog(log);

QStringList tos;
tos << "yuanshao" << "shuangxiong" << "zhenji" << "liubei";

Expand All @@ -258,7 +227,6 @@ class GuanduRule: public ScenarioRule{

room->moveCardTo(Sanguosha->getCard(card_id), to, Player::Judging, true);
}
room->setPlayerProperty(Guandu_zhangliao, "general", "zhangliao");
}

break;
Expand Down Expand Up @@ -294,18 +262,16 @@ GuanduScenario::GuanduScenario()
{
lord = "yuanshao";
loyalists << "shuangxiong" << "zhenji";
rebels << "caocao" << "guandu-zhangliao" << "guojia";
rebels << "caocao" << "zhangliao" << "guojia";
renegades << "liubei" << "guanyu";

rule = new GuanduRule(this);

skills << new ZhanShuangxiong
skills << new SmallTuxi
<< new ZhanShuangxiong
<< new GreatYiji
<< new DamageBeforePlay;

General *Guandu_zhangliao = new General(this, "guandu-zhangliao", "wei", 4, true, true);
Guandu_zhangliao->addSkill(new SmallTuxi);

addMetaObject<ZhanShuangxiongCard>();
addMetaObject<SmallTuxiCard>();
}
Expand All @@ -317,10 +283,6 @@ AI::Relation GuanduScenario::relationTo(const ServerPlayer *a, const ServerPlaye
return AI::GetRelation(a, b);
}

void GuanduScenario::getRoles(char *roles) const{
strcpy(roles, "ZCCFFFNN");
}

void GuanduScenario::onTagSet(Room *room, const QString &key) const{
bool zhanshuangxiong = room->getTag("ZhanShuangxiong").toBool();
bool burnwuchao = room->getTag("BurnWuchao").toBool();
Expand Down
1 change: 0 additions & 1 deletion src/scenario/guandu-scenario.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class GuanduScenario : public Scenario{
GuanduScenario();

virtual AI::Relation relationTo(const ServerPlayer *a, const ServerPlayer *b) const;
virtual void getRoles(char *roles) const;
virtual void onTagSet(Room *room, const QString &key) const;
};

Expand Down
Loading

0 comments on commit cba0caf

Please sign in to comment.