/**
* Copyright 2019 Heroic Labs and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using DemoGame.Scripts.Gameplay.Hands;
using DemoGame.Scripts.Gameplay.Units;
using UnityEngine;
namespace DemoGame.Scripts.Gameplay.Cards
{
///
/// Contains information of a single card type.
/// Stores the prefab instantiated on card play.
///
[CreateAssetMenu(fileName = "Card", menuName = "Deck/Card")]
public class CardInfo : ScriptableObject
{
#region Fields
#region Basic Info
[Header("Basic Info")]
///
/// The type of this card.
/// Each distinct must have a different .
///
[SerializeField] private CardType _cardtype = CardType.None;
///
/// The name of this card.
///
[SerializeField] private string _name = string.Empty;
///
/// Description of the effect.
///
[Multiline] [SerializeField] private string _description = string.Empty;
///
/// The sprite visible on this card.
///
[SerializeField] private Sprite _sprite = null;
///
/// The coct of playing this card.
///
[SerializeField] private int _cost = 0;
#endregion
#region Stats
[Header("Stats")]
///
/// Base unit health.
///
[SerializeField] private int _health = 0;
///
/// Health gained per level.
///
[SerializeField] private int _healthPerLevel = 0;
///
/// Base unit damage per attack.
///
[SerializeField] private int _damage = 0;
///
/// Damage gained per level.
///
[SerializeField] private int _damagePerLevel = 0;
///
/// Type of performed attack.
///
[SerializeField] private AttackType _attackeType = AttackType.Simple;
///
/// Base unit reload time. The greater reload time the more time
/// it takes for the unit to attack.
///
[SerializeField] private float _reloadTime = 0;
///
/// Reload time gained (decreased) per level.
///
[SerializeField] private float _reloadTimePerLevel = 0;
///
/// Base unit move speed. This is the time in seconds this unit needs to move
/// from one node to another.
///
[SerializeField] private float _moveSpeed = 0;
///
/// Move speed gain (decrease) per level.
///
[SerializeField] private float _moveSpeedPerLevel = 0;
///
/// Base unit rotation speed. This is the time in seconds this unit needs to rotate around.
///
[SerializeField] private float _rotationSpeed = 0;
///
/// rotation speed gain (decrease) per level.
///
[SerializeField] private float _rotationSpeedPerLevel = 0;
#endregion
#region Drag and Drop Info
[Header("Drag and Drop Info")]
///
/// Determines where on the battlefield this card can be played.
///
[SerializeField] private DropRegion _dropRegion = DropRegion.WholeMap;
///
/// Determines if card can be played on node that contains any units
///
[SerializeField] private bool _canBeDroppedOverOtherUnits = false;
///
/// GameObject instantiated whenever this card is hovered over the battlefield.
///
[SerializeField] private DropVisualizer _visualizerPrefab = null;
#endregion
#endregion
#region Properties
#region Basic Info
///
/// Returns the of this card
///
public CardType CardType => _cardtype;
///
/// Returns the of this card.
///
public string Name => _name;
///
/// Returns the of this card.
///
public string Description => _description;
///
/// Returns the visible on this card.
///
public Sprite Sprite => _sprite;
///
/// Returns the of playing this card.
///
public int Cost => _cost;
#endregion
#region Stats
///
/// Base unit health.
///
public int Health => _health;
///
/// Health gained per level.
///
public int HealthPerLevel => _healthPerLevel;
///
/// Base unit damage per attack.
///
public int Damage => _damage;
///
/// Damage gained per level.
///
public int DamagePerLevel => _damagePerLevel;
///
/// Type of performed attack.
///
public AttackType AttackeType => _attackeType;
///
/// Base unit reload time per second. The greater reload time the more time
/// it takes for the unit to attack.
///
public float ReloadTime => _reloadTime;
///
/// Reload time gained (decreased) per level.
///
public float ReloadTimePerLevel => _reloadTimePerLevel;
///
/// Base unit move speed. This is the time in seconds this unit needs to move
/// from one node to another.
///
public float MoveSpeed => _moveSpeed;
///
/// Move speed gain (decrease) per level.
///
public float MoveSpeedPerLevel => _moveSpeedPerLevel;
///
/// Base unit rotation speed. This is the time in seconds this unit needs to rotate around.
///
public float RotationSpeed => _rotationSpeed;
///
/// rotation speed gain (decrease) per level.
///
public float RotationSpeedPerLevel => _rotationSpeedPerLevel;
#endregion
#region Drag and Drop Info
///
/// Determines where on the battlefield this card can be played.
///
public DropRegion DropRegion => _dropRegion;
///
/// Determines if card can be played on node that contains any units
///
public bool CanBeDroppedOverOtherUnits => _canBeDroppedOverOtherUnits;
///
/// Returns the prefab spawned whenever this card is hovered over battlefield.
///
public DropVisualizer VisualizerPrefab => _visualizerPrefab;
#endregion
#endregion
}
}