Browse Source

fix: 🐛 fix a bug of returning null when using Skill

tags/0.1.0
shangfengh 2 years ago
parent
commit
488b390c08
3 changed files with 13 additions and 9 deletions
  1. +1
    -0
      logic/GameClass/GameObj/Character/Character.Skill.cs
  2. +4
    -0
      logic/GameClass/GameObj/Character/Skill.cs
  3. +8
    -9
      logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs

+ 1
- 0
logic/GameClass/GameObj/Character/Character.Skill.cs View File

@@ -2,6 +2,7 @@
using Preparation.Interface;
using System.Collections.Generic;
using System;
using System.Numerics;

namespace GameClass.GameObj
{


+ 4
- 0
logic/GameClass/GameObj/Character/Skill.cs View File

@@ -80,6 +80,10 @@ namespace GameClass.GameObj
return new BecomeInvisible();
case ActiveSkillType.UseKnife:
return new UseKnife();
case ActiveSkillType.CanBeginToCharge:
return new CanBeginToCharge();
case ActiveSkillType.Punish:
return new Punish();
default:
return new NullSkill();
}


+ 8
- 9
logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs View File

@@ -30,15 +30,12 @@ namespace Gaming

if ((!player.Commandable())) return false;
IActiveSkill skill = player.UseIActiveSkill(ActiveSkillType.CanBeginToCharge);
return ActiveSkillEffect(skill, player, () =>
{
player.AddMoveSpeed(skill.DurationTime, 3.0);
//player.BulletOfPlayer = BulletType.Ram;
new Thread
Debugger.Output(player, "can begin to charge!");
new Thread
(
() =>
{
new FrameRateTaskExecutor<int>(
new FrameRateTaskExecutor<int>(
loopCondition: () => player.Commandable() && gameMap.Timer.IsGaming,
loopToDo: () =>
{
@@ -70,8 +67,11 @@ namespace Gaming
}

)
{ IsBackground = true }.Start();
Debugger.Output(player, "can begin to charge!");
{ IsBackground = true }.Start();

return ActiveSkillEffect(skill, player, () =>
{
player.AddMoveSpeed(skill.DurationTime, 3.0);
},
() =>
{
@@ -161,7 +161,6 @@ namespace Gaming
ActiveSkillType activeSkillType = SkillFactory.FindActiveSkillType(activeSkill);
if (player.TimeUntilActiveSkillAvailable[activeSkillType] == 0)
{

player.SetTimeUntilActiveSkillAvailable(activeSkillType, activeSkill.SkillCD);
new Thread
(() =>


Loading…
Cancel
Save