Giter Site home page Giter Site logo

fightsystem's Introduction

FightSystem

插件永久免费


插件

说明 内容
兼容版本 1.12.2+
软依赖 PlaceholderAPI Mythicmobs SkillAPI Magic

GitHub Release

介绍

FightSystem 是基于 TabooLib VI Pouvoir AttributeSystem 编写的一款战斗系统插件
其基于AttributeSystem,提供了一些基本的属性 以及一套完整的,客制化的战斗流程系统
您可以通过此插件编写复杂的战斗流程 (例如原神的元素反应 英雄联盟的战斗系统 )
其提供了包括但不限于以下功能/模块:


对于一些可扩展API,FightSystem 提供了脚本拓展 并使用脚本注解进行自动注册注销

详细请见WIKI

机制 (Mechanic)

@AutoRegister
object MyMechanic : Mechanic("my_mechanic") {
    override fun exec(fightData: FightData, context: Map<String, Any>, damageType: DamageType): Any? {
        val attacker = fightData.attacker ?: return false
        val defender = fightData.defender
        val power = max(if (attacker is Player) attacker.level else 0, 0)
        val damage = Coerce.toDouble(context["formula"])
        val players = attacker.getNearbyEntities(10.0, 10.0, 10.0).filterIsInstance<Player>().map { adaptPlayer(it) }
        val location = adaptLocation(defender.location)
        ProxyParticle.EXPLOSION_LARGE.sendTo(location, range = 10.0)
        fightData.damageSources["my_mechanic_damage"] = Plus.element(power * 10 + damage)
        return true
    }
}
var Coerce = static("Coerce");
var Player = find("org.bukkit.entity.Player");
var ProxyParticle = find(">taboolib.common.platform.ProxyParticle");

//@Mechanic(my_mechanic)
function exec(fightData, context, damageType) {
    var attacker = fightData.attacker;
    var defender = fightData.defender;
    var power = attacker instanceof Player ? attacker.level : 0;
    var damage = calculate(context.get("formula"), attacker);
    var location = defender.location;
    var particle = ProxyParticle.EXPLOSION_LARGE;
    Tool.sendSimpleParticle(particle, location, 36.0, 100, 1.0);
    fightData.damageSources.put(
        "my_mechanic_damage",
        Plus.element(power * 10 + damage)
    );
    return true;
}

Links

WIKI http://blog.skillw.com/#sort=FightSystem&doc=README.md

JavaDoc http://doc.skillw.com/FightSystem/

爱发电 https://afdian.net/@glom_

fightsystem's People

Contributors

glomzzz avatar q210520993 avatar ling556 avatar mkbaka avatar

Stargazers

Nan avatar  avatar  avatar  avatar Yuri avatar ItsFlicker avatar

Watchers

 avatar

fightsystem's Issues

目前已知bug

1.mm技能兼容 att-damage 内部实现最后是使用mm的api doDamage来打伤害的 这个玩意必须得同步运行 不然在某些异步的技能内执行时会报错
2.玩家持续攻击时会无敌 看过实现的代码了 可能是因为错误的给攻击者添加了无敌帧 经过我测试 当我把无敌帧功能关闭后 玩家持续攻击也会正常受到伤害

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.