Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:Universal Describtor for pieces #3

Open
BernieHuang2008 opened this issue May 22, 2024 · 2 comments
Open

feat:Universal Describtor for pieces #3

BernieHuang2008 opened this issue May 22, 2024 · 2 comments

Comments

@BernieHuang2008
Copy link
Contributor

BernieHuang2008 commented May 22, 2024

我觉得为每个棋子写一个函数太麻烦了,最好能弄一种"通用描述符",也就是用几个参数描述所有棋子。

我想可以初步具备这个结构(json):

{
    "id": "D",
    "name": "Deng",
    "attackLv": 1,     # 攻击级别,若底下的棋子防御级别<this,就会被打掉
    "defendLv": 2,     # 2级防御
    "attackSpec": ["T"],    # 针对tly,克制
}

但是我还没想好H,x这种范围伤害该怎么办

@BernieHuang2008
Copy link
Contributor Author

BernieHuang2008 commented May 22, 2024

你有什么好想法吗?关于h和x的,@Lsccccc

我有一个想法但是不是很好,就是写一个条件判断,如果命中了就吃掉,比如说:for x:

conditions:
  - abs(target.x-this.x)<=1
  - abs(target.y-this.y)<=1
  - target.gender="M"

之类的表达式,我们还可以弄集合之类的,这都是后话了

@BernieHuang2008
Copy link
Contributor Author

BernieHuang2008 commented May 22, 2024

集合的话,这是具体的细节:

conditions:
  - my_cond_set_1:
    op: AND
    exps:
      - abs(...)
      - abs(...)

  - mycondset2:
    op: OR
    exps:
      - 1=1
      - 0=1

第一组exps需要全部满足
第二组exps只用满足一个
两组exp的结果做and运算

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant