Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System;
- using System.Collections.Generic;
- [RequireComponent(typeof(MonsterName))]
- [RequireComponent(typeof(MonsterHealth))]
- [RequireComponent(typeof(MonsterLevel))]
- [RequireComponent(typeof(MonsterBattle))]
- [RequireComponent(typeof(MonsterAttack))]
- [RequireComponent(typeof(MonsterDefense))]
- [RequireComponent(typeof(MonsterExperience))]
- [RequireComponent(typeof(MonsterFollowPlayer))]
- public class MonsterBase : MonoBehaviour
- {
- public string Name = "changeme";
- public int Health = 100;
- public int CurrentLevel = 0;
- public int LevelsMax = 100;
- public int Attack = 10;
- public int Defense = 10;
- public int Experience = 0;
- public Sprite sprite;
- public List<MonsterAbility> MonsterAbilities = new List<MonsterAbility>();
- public bool isWild = true;
- MonsterBattle attackFunctions;
- void Start()
- {
- attackFunctions = GetComponent<MonsterBattle>();
- }
- void Update()
- {
- // For debugging purposes
- if (!isWild)
- {
- if (Input.GetKeyDown(KeyCode.Alpha1))
- {
- attackFunctions.AttackOpponent(transform.gameObject, MonsterAbilities[0]);
- Debug.Log(MonsterAbilities[0].abilityDescription);
- }
- if (Input.GetKeyDown(KeyCode.Alpha2))
- {
- attackFunctions.AttackOpponent(transform.gameObject, MonsterAbilities[1]);
- Debug.Log(MonsterAbilities[1].abilityDescription);
- }
- if (Input.GetKeyDown(KeyCode.Alpha3))
- {
- attackFunctions.AttackOpponent(transform.gameObject, MonsterAbilities[2]);
- Debug.Log(MonsterAbilities[2].abilityDescription);
- }
- if (Input.GetKeyDown(KeyCode.Alpha4))
- {
- attackFunctions.AttackOpponent(transform.gameObject, MonsterAbilities[3]);
- Debug.Log(MonsterAbilities[3].abilityDescription);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment