59 lines
1.2 KiB
C#
59 lines
1.2 KiB
C#
using Godot;
|
|
using System;
|
|
|
|
public partial class Cog : Node2D
|
|
{
|
|
[Export]
|
|
public int Aptitude = 10, Agility = 10, Ardor = 10, Accuity = 10, Awareness = 10, Appeal = 10;
|
|
|
|
public bool _dead;
|
|
public int _health, _healthMax, _energy, _energyMax, _stamina, _staminaMax, _burden, _turnBandwidth, _turnBandwidthMax, _battleBandwidth, _criticalChance;
|
|
|
|
public override void _Ready()
|
|
{
|
|
_dead = false;
|
|
_health = Ardor * 12;
|
|
_healthMax = _health;
|
|
_energy = Accuity * 12;
|
|
_energyMax = _energy;
|
|
_stamina = Agility * 12;
|
|
_staminaMax = _stamina;
|
|
_burden = Appeal / 12;
|
|
_turnBandwidth = (int)(Awareness * 2 / 3);
|
|
_turnBandwidthMax = _turnBandwidth;
|
|
_battleBandwidth = _turnBandwidthMax * 4;
|
|
_criticalChance = 10;
|
|
|
|
}
|
|
|
|
public void Attack(Marble target)
|
|
{
|
|
Marble marble = GetNode<Marble>("Marble");
|
|
if (marble.Launched)
|
|
{
|
|
target.DefenseChange(-3);
|
|
}
|
|
}
|
|
|
|
public void HealthChange(int change)
|
|
{
|
|
_health += change;
|
|
if (_health < 0)
|
|
{
|
|
_dead = true;
|
|
}
|
|
}
|
|
|
|
public void HoldMarble()
|
|
{
|
|
Marble marble = GetNode<Marble>("Marble");
|
|
marble.Holding = true;
|
|
}
|
|
|
|
public void PlaceMarble(Vector2 position)
|
|
{
|
|
Marble marble = GetNode<Marble>("Marble");
|
|
marble.Start(position);
|
|
}
|
|
}
|