Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Python_program
帝国:崛起
提交
1164cdc5
帝
帝国:崛起
项目概览
Python_program
/
帝国:崛起
与 Fork 源项目一致
Fork自
inscode / Python
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
帝
帝国:崛起
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
You need to sign in or sign up before continuing.
提交
1164cdc5
编写于
8月 05, 2025
作者:
P
python_program
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Tue Aug 5 22:02:00 CST 2025 inscode
上级
0170e40e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
33 addition
and
0 deletion
+33
-0
main.py
main.py
+33
-0
未找到文件。
main.py
浏览文件 @
1164cdc5
...
@@ -42,6 +42,7 @@ class soil:
...
@@ -42,6 +42,7 @@ class soil:
class
army
:
class
army
:
action
=
1
#1:防御 2:进攻
number
=
0
number
=
0
morale
=
1
morale
=
1
weapons
=
"腰刀"
weapons
=
"腰刀"
...
@@ -73,3 +74,35 @@ class army:
...
@@ -73,3 +74,35 @@ class army:
elif
self
.
weapons
==
"火铳"
:
elif
self
.
weapons
==
"火铳"
:
perPower
=
10
perPower
=
10
return
self
.
number
*
self
.
morale
*
perPower
*
self
.
skill
return
self
.
number
*
self
.
morale
*
perPower
*
self
.
skill
def
kill
(
kingdom1
,
kingdom2
):
kingdom1
.
gold
+=
kingdom2
.
gold
kingdom1
.
pollution
+=
kingdom2
.
pollution
kingdom1
.
soil
.
area
+=
kingdom2
.
soil
.
area
kingdom2
=
kingdom
(
""
,
[],
None
,
None
,
0
,
0
)
return
def
attack
(
attacker
,
defauendert
,
area
):
defauendert
.
army
.
number
-=
attacker
.
army
.
battleEffectiveness
()
/
(
defauendert
.
battleEffectiveness
()
/
defauendert
.
army
.
number
)
defauendert
.
army
.
morale
-=
0.05
if
defauendert
.
army
.
number
<=
200
:
print
(
"进攻方胜利!防守方失败!{}沦陷!"
.
format
(
area
))
defauendert
.
area
.
remove
(
area
)
attacker
.
area
.
append
(
area
)
if
not
defauendert
.
area
:
print
(
"{}灭亡!{}占领全境,获得{}黄金,获得{}人口,获得{}土地!"
.
format
(
defauendert
,
attacker
,
defauendert
.
gold
,
defauendert
.
pollution
,
defauenderter
.
soil
.
area
))
kill
(
attacker
,
defauendert
)
defauendert
.
army
.
number
=
0
defauendert
.
army
.
morale
-=
0.5
elif
defauendert
.
army
.
number
>
200
:
print
(
"防守方胜利!进攻方失败!{}守住了!"
.
format
(
area
))
attacker
.
army
.
morale
-=
0.05
defauendert
.
army
.
morale
+=
0.05
attacker
.
army
.
number
-=
defauendert
.
army
.
battleEffectiveness
()
/
(
attacker
.
battleEffectiveness
()
/
attacker
.
army
.
number
)
else
:
print
(
"NUMBER ERROR!"
)
return
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录