# 河豚剑

## 任务

按照下面物品配置的 Lore 的描述制作一把河豚剑。

```
- id: pufferfish_sword
  baseAttackSpeed: 我们还不知道呢
  baseDamage: 我们还不知道呢
  item:
    item: pufferfish unbreaking:1 unbreakable hide_attributes hide_enchants
    lore:
    - '&7伤害: &c10❤'
    - ''
    - '&7攻击时还会对附近的敌人造成你当前'
    - '&7力量属性值的 &a20% &7值的范围伤害!'
    - '&7最多造成 &c20 &7点伤害!'
    - ''
    - '&a&l稀有'
    displayName: '&a河豚攻击'
    recipe: []
    craftable: false
  fuels: []
  effects: 我们还不知道呢
  conditions: []
```

## 逐步分析

很明显我们还是使用 EcoItems 插件。

#### 伤害: 10❤

由于是近战攻击，我们可以直接将该物品的 `baseDamage` 选项填写为 **10** 即可，根据原版特性，将 `baseAttackSpeed` 选项填写为 1.6。

#### 范围伤害

很明显范围伤害我们选用 `damage_nearby_entities` 技能，而如何实现根据当前玩家的 **EcoSkills** 力量属性实现修改范围伤害技能的伤害值呢？

答案是使用变量符。

如果一切正常，我们现在的第一个 `effects` 选项的值如下：

```
    - id: damage_nearby_entities
      args:
        damage: '%ecoskills_strength% * 0.2'
        radius: 5 
        damage_as_player: false
        damage_self: false
      triggers:
        - melee_attack
```

{% hint style="info" %}
想一想，damage\_as\_player 和 damage\_self 的选项为什么是 false，如果你不知道，请查看技能列表的 **D** 一节和实战训练下的 **末影弓** 一节。
{% endhint %}

#### 最多造成 20 点伤害

根据玩家力量属性 \* 20% 的设定，我们很轻松就可以判断当玩家的力量属性超过 100 点时，该武器的伤害就会超过 20 点。

所以，我们的技能需要拆分为两个，第一个是当力量属性少于 100 点时，第二个是力量属性高于 100 点时。第二个技能的伤害值将固定为 20 点。

## 参考答案

### EcoItems

```
- id: pufferfish_sword
  baseAttackSpeed: 1.6
  baseDamage: 10
  item:
    item: pufferfish unbreaking:1 unbreakable hide_attributes hide_enchants
    lore:
    - '&7伤害: &c10❤'
    - ''
    - '&7攻击时还会对附近的敌人造成你当前'
    - '&7力量属性值的 &a20% &7值的范围伤害!'
    - '&7最多造成 &c20 &7点伤害!'
    - ''
    - '&a&l稀有'
    displayName: '&a河豚攻击'
    recipe: []
    craftable: false
  fuels: []
  effects: 
    - id: damage_nearby_entities
      args:
        damage: '%ecoskills_strength% * 0.2'
        radius: 5 
        damage_as_player: false
        damage_self: false
      triggers:
        - melee_attack
      conditions:
        - id: placeholder_less_than
          args:
            placeholder: '%ecoskills_strength%'
            value: 100 
          not-met-effects: []
    - id: damage_nearby_entities
      args:
        damage: 20
        radius: 5 
        damage_as_player: false
        damage_self: false
      triggers:
        - melee_attack
      conditions:
        - id: placeholder_greater_than
          args:
            placeholder: '%ecoskills_strength%'
            value: 100 
          not-met-effects: []
  conditions: []
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.superiormc.cn/ecox-doc/shi-zhan-xun-lian/he-tun-jian.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
