73 lines
2.5 KiB
C#
73 lines
2.5 KiB
C#
using System.Collections.Generic;
|
|
using Cielonos.MainGame.Buffs.Character;
|
|
using Cielonos.MainGame.Characters;
|
|
using Cielonos.MainGame.UI;
|
|
using INab.WorldScanFX.URP;
|
|
using UnityEngine;
|
|
|
|
namespace Cielonos.MainGame
|
|
{
|
|
namespace Inventory.Collections
|
|
{
|
|
public class Scanner : SupportEquipmentBase
|
|
{
|
|
public ScanFX scannerEffect;
|
|
private Transform scanOrigin;
|
|
public override void OnObtained()
|
|
{
|
|
base.OnObtained();
|
|
scanOrigin = player.bodyPartsSc.AuxiliaryDrone.center;
|
|
scannerEffect.scanOrigin = scanOrigin;
|
|
}
|
|
|
|
public override void OnPress()
|
|
{
|
|
if (functionSm["Scan"].IsAvailable())
|
|
{
|
|
//audioContainer.PlaySoundFX("Scan", scanOrigin.gameObject);
|
|
scannerEffect.StartScan(1);
|
|
|
|
List<Enemy> enemies = CombatManager.EnemySm.GetEnemiesInRadius(scanOrigin.position, 50f);
|
|
enemies.ForEach(enemy => new Scanner_WeaknessDetection().Apply(enemy));
|
|
|
|
functionSm["Scan"].Execute();
|
|
|
|
PlayerCanvas.SupportEquipmentsUIArea[this].UseOutlineAnimation();
|
|
}
|
|
else
|
|
{
|
|
PlayerCanvas.SupportEquipmentsUIArea[this].CanNotUseOutlineAnimation();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
namespace Buffs.Character
|
|
{
|
|
public class Scanner_WeaknessDetection : CharacterBuffBase
|
|
{
|
|
public Scanner_WeaknessDetection()
|
|
{
|
|
Initialize(BuffType.Negative, BuffDispelLevel.Basic);
|
|
this.contentSubmodule = new ContentSubmodule(this);
|
|
this.timeSubmodule = new TimeSubmodule(this, 15f);
|
|
this.attributeSubmodule = new AttributeSubmodule(this);
|
|
this.attributeSubmodule.percentageChangeOfAccumulation.Add(CharacterAttribute.FinalDamageReceivedMultiplier, 0.1f);
|
|
}
|
|
|
|
public override bool OnBuffApply(out CharacterBuffBase existingBuff)
|
|
{
|
|
MainGameManager.BaseCollection.InfoText().Spawn(attachedCharacter.centerPoint.position, "Weakness Detected!");
|
|
|
|
if (FindExistingSameBuff(out existingBuff))
|
|
{
|
|
existingBuff.timeSubmodule.RefreshDuration();
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|