Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…gemony into dev
  • Loading branch information
lrl026 committed Nov 9, 2014
2 parents 8874b44 + 06bb4d3 commit fe9ebd7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
26 changes: 13 additions & 13 deletions lua/ai/basara-ai.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ sgs.ai_skill_choice["GameRule:TriggerOrder"] = function(self, choices, data)
for _, skill in ipairs(bothShow) do
if self.player:hasSkills(skill) then
if canShowHead then
return math.random() < 0.6 or "GameRule_AskForGeneralShowHead"
return math.random() < 0.5 or "GameRule_AskForGeneralShowHead"
elseif canShowDeputy then
return math.random() < 0.6 or "GameRule_AskForGeneralShowDeputy"
return math.random() < 0.5 or "GameRule_AskForGeneralShowDeputy"
end
end
end
Expand All @@ -149,7 +149,7 @@ sgs.ai_skill_choice["GameRule:TriggerOrder"] = function(self, choices, data)
for _, skill in ipairs(firstShow) do
if self.player:hasSkill(skill) and not self.player:hasShownOneGeneral() then
if self.player:inHeadSkills(skill) and canShowHead then
return math.random() < 0.5 or "GameRule_AskForGeneralShowHead"
return math.random() < 0.4 or "GameRule_AskForGeneralShowHead"
elseif canShowDeputy then
return math.random() < 0.3 or "GameRule_AskForGeneralShowDeputy"
end
Expand All @@ -161,7 +161,7 @@ sgs.ai_skill_choice["GameRule:TriggerOrder"] = function(self, choices, data)
for _, skill in ipairs(needShowForAttack) do
if self.player:hasSkill(skill) and not self.player:hasShownOneGeneral() then
if self.player:inHeadSkills(skill) and canShowHead then
return math.random() < 0.6 or "GameRule_AskForGeneralShowHead"
return math.random() < 0.5 or "GameRule_AskForGeneralShowHead"
elseif canShowDeputy then
return math.random() < 0.2 or "GameRule_AskForGeneralShowDeputy"
end
Expand All @@ -173,7 +173,7 @@ sgs.ai_skill_choice["GameRule:TriggerOrder"] = function(self, choices, data)
for _, skill in ipairs(needShowForLead) do
if self.player:hasSkill(skill) and not self.player:hasShownOneGeneral() then
if self.player:inHeadSkills(skill) and canShowHead then
return math.random() < 0.4 or "GameRule_AskForGeneralShowHead"
return math.random() < 0.3 or "GameRule_AskForGeneralShowHead"
elseif canShowDeputy then
return math.random() < 0.2 or "GameRule_AskForGeneralShowDeputy"
end
Expand Down Expand Up @@ -206,9 +206,9 @@ sgs.ai_skill_choice["GameRule:TriggerOrder"] = function(self, choices, data)
end
if (shown > 0 and e < notshown-1 ) or (self.player:hasShownOneGeneral()) then
if self.player:inHeadSkills(skill) and canShowHead then
return math.random() < 0.5 or "GameRule_AskForGeneralShowHead"
return math.random() < 0.4 or "GameRule_AskForGeneralShowHead"
elseif canShowDeputy then
return math.random() < 0.5 or "GameRule_AskForGeneralShowDeputy"
return math.random() < 0.4 or "GameRule_AskForGeneralShowDeputy"
end
end
end
Expand All @@ -218,9 +218,9 @@ sgs.ai_skill_choice["GameRule:TriggerOrder"] = function(self, choices, data)
local cho = { "GameRule_AskForGeneralShowHead", "GameRule_AskForGeneralShowDeputy"}
return cho[math.random(1, #cho)]
elseif canShowHead then
return math.random() < 0.7 or "GameRule_AskForGeneralShowHead"
return math.random() < 0.5 or "GameRule_AskForGeneralShowHead"
elseif canShowDeputy then
return math.random() < 0.6 or "GameRule_AskForGeneralShowDeputy"
return math.random() < 0.4 or "GameRule_AskForGeneralShowDeputy"
end
end
end
Expand Down Expand Up @@ -269,20 +269,20 @@ sgs.ai_skill_choice["GameRule:TurnStart"] = function(self, choices, data)
if canShowHead then
if self.player:isDuanchang() then return "GameRule_AskForGeneralShowHead" end
for _, p in ipairs(self.enemies) do
if p:hasShownSkills("mingshi|huoshui") then return "GameRule_AskForGeneralShowHead" end
if p:hasShownSkills("mingshi|huoshui") then return math.random() < 0.4 or "GameRule_AskForGeneralShowHead" end
end
elseif canShowDeputy then
if self.player:isDuanchang() then return "GameRule_AskForGeneralShowDeputy" end
for _, p in ipairs(self.enemies) do
if p:hasShownSkills("mingshi|huoshui") then return "GameRule_AskForGeneralShowDeputy" end
if p:hasShownSkills("mingshi|huoshui") then return math.random() < 0.4 or "GameRule_AskForGeneralShowDeputy" end
end
end

if not self.player:hasShownOneGeneral() then
local gameProcess = sgs.gameProcess():split(">>")
if self.player:getKingdom() == gameProcess[1] and (self.player:getLord() or sgs.shown_kingdom[self.player:getKingdom()] < self.player:aliveCount() / 2) then
if canShowHead then return "GameRule_AskForGeneralShowHead"
elseif canShowDeputy then return "GameRule_AskForGeneralShowDeputy" end
if canShowHead then return math.random() < 0.6 or "GameRule_AskForGeneralShowHead"
elseif canShowDeputy then return math.random() < 0.6 or "GameRule_AskForGeneralShowDeputy" end
end
end

Expand Down
7 changes: 5 additions & 2 deletions lua/ai/chat-ai.lua
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ sgs.ai_chat_func[sgs.GeneralShown].show = function(self, player, data)
local name2 = sgs.Sanguosha:translate(self.player:getGeneral2Name())
local kingdom = sgs.Sanguosha:translate(self.player:getKingdom())
local chat = {
"这种将都亮",
"亮这个将有什么意义",
"我还当你多牛的将呢。。"
}
local notshown, shown= 0, 0
Expand All @@ -351,7 +351,10 @@ sgs.ai_chat_func[sgs.GeneralShown].show = function(self, player, data)
end
if notshown < 3 then
table.insert(chat,"终于亮了")
end
end
if self.player:getRole() == "careerist" then
table.insert(chat,"野了")
end
if not self.player:hasShownAllGenerals() then
table.insert(chat,self.player:screenName() .."原来是"..kingdom)
table.insert(chat,"看来这是大"..kingdom.."的节奏")
Expand Down
1 change: 1 addition & 0 deletions lua/ai/standard-wei-ai.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,7 @@ local qiangxi_skill = {}
qiangxi_skill.name = "qiangxi"
table.insert(sgs.ai_skills, qiangxi_skill)
qiangxi_skill.getTurnUseCard = function(self)
if not self:willShowForAttack() then return end
if not self.player:hasUsed("QiangxiCard") then
return sgs.Card_Parse("@QiangxiCard=.&qiangxi")
end
Expand Down

0 comments on commit fe9ebd7

Please sign in to comment.