Giter Club home page Giter Club logo

Comments (8)

Fsu0413 avatar Fsu0413 commented on July 17, 2024

Fs的思路:flag改mark,修改双雄加时机
修改Client::setMark()函数,处理失去技能

from qsanguosha-v2.

xusine avatar xusine commented on July 17, 2024

@Fsu0413 具体的要怎么做

from qsanguosha-v2.

Fsu0413 avatar Fsu0413 commented on July 17, 2024

先干掉skillStateChanged函数,相关的东西都干掉
然后参考国战移植

from qsanguosha-v2.

Fsu0413 avatar Fsu0413 commented on July 17, 2024

我来吧

from qsanguosha-v2.

Fsu0413 avatar Fsu0413 commented on July 17, 2024

@Xusine1131
Lua接口不用加,只需要在技能效果持续期间,放置一个Mark,名为:ViewAsSkill_xxxEffect (xxx替换为视为技或触发技的技能的objectName)。此时在失去技能时就不会失去技能按钮,直到此Mark的数量被设置为0。

具体实现:(比如某技能的技能名为xxx)
在失去技能时,先判断当前ClientPlayer是否有形如“ViewAsSkill_xxxEffect”(xxx替换为技能的objectName)的Mark,如果有,则在客户端本地(此处注意!!服务端没有!!)添加一个形如“ViewAsSkill_xxxLost”的Mark,并且不删除技能按钮。(实现在RoomScene::detachSkill()中)
当一个形为ViewAsSkill_xxxEffect的Mark的数量被设置为0时,如果ClientPlayer有形如“ViewAsSkill_xxxLost”的Mark,并且技能列表里也没有xxx技能,则对“ViewAsSkill_xxxLost”的Mark在客户端进行清除,并且删除技能按钮。(实现在Client::setMark()中)
此方法改编于国战双雄的耦合,话说国战双雄的耦合是实现在Client::notifyProperty()函数中的,如果想解耦的话,按照这个思路解耦就行了。

from qsanguosha-v2.

Fsu0413 avatar Fsu0413 commented on July 17, 2024

@SwordElucidator AI对可以使用视为技有一句hasFlag(skill:objectName())的判断,改为getMark("ViewAsSkill_" .. skill:objectName() .. "Effect") > 0

这段语句来源于之前双雄的实现,不过因为双雄修改了实现所以hasFlag已经没有实际作用了。

from qsanguosha-v2.

xusine avatar xusine commented on July 17, 2024

@Fsu0413 国战还需要这样搞API么

from qsanguosha-v2.

Fsu0413 avatar Fsu0413 commented on July 17, 2024

@Xusine1131 不用

from qsanguosha-v2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.