// jiguang-gun.c

#include <ansi.h>
inherit SKILL;

mapping *action = ({
        ([      "action":       HIR"$N紧握手中的$w，瞄准$n的$l连开数枪"NOR,
                "dodge":        10,
                "parry" :       10,
                "force":        50,
                "damage" :      50,
                "damage_type":  "枪伤"
        ]),
        ([      "action":       HIM"只见$N手中$w发出十道"HIR"雷射光"HIM"，狂风骤雨般地向$n扫去"NOR,
                "dodge":        -10,
                "parry" :       20,
                "force" :       100,
                "damage":       70,
                "damage_type":  "枪伤"
        ]),
        ([      "action":       HIG"$N跃起空中，手中$w对准$n一顿扫射，打得$n根本就抬不起头来"NOR,
                "dodge":        10,
                "parry" :       10,
                "force":        150,
                "damage" :      80,
                "damage_type":  "枪伤"
        ]),
        ([      "action":       HIB"$N找个隐蔽的地方爬下，对准$n的$l就是一枪"NOR,
                "dodge":        20,
                "parry" :       30,
                "force" :       200,
                "damage":       120,
                "damage_type":  "枪伤"
        ]),
 
});

int valid_learn(object me)
{
        object ob;
        if( !(ob = me->query_temp("weapon"))
        ||      (string)ob->query("skill_type") != "gun" )
                return notify_fail("你必须先找一把枪。\n");
        return 1;

}

int valid_enable(string usage)
{
        return usage=="gun" || usage=="parry";
}

mapping query_action(object me, object weapon)
{
        return action[random(sizeof(action))];
}

int practice_skill(object me)
{
        if( (int)me->query("qi") < 20
        ||      (int)me->query("neili") < 15 )
                return notify_fail("你的内力或气不够，没有办法练习金蛇剑法。\n");
        me->receive_damage("qi", 10);
        me->add("neili", -10);
        write("你对着远处的物体瞄了一阵，似乎有点心得。\n");
        return 1;
}

string perform_action_file(string action)
{
        return __DIR__"jiguang-gun/" + action;
}
