// Use this for initialization void Start () { attComp = (AttributeComponent)gameObject.GetComponent(typeof(AttributeComponent)); movement = (CharacterMovement)gameObject.GetComponent(typeof(CharacterMovement)); meleeSys = (MeleeSystem)gameObject.GetComponent(typeof(MeleeSystem)); rangedSys = (RangedSystem)GetComponent(typeof(RangedSystem)); abilitySys = (AbilitySystem)GetComponent(typeof(AbilitySystem)); }
private void OnAbilityClick(Ability ab) { SoundManager.instance.EffectSourcePlay(AudioClipManager.instance.ui_button_default); if (ab != null) { abilityInfoImage.sprite = Resources.Load <Sprite>(ab.image); abilityInfoNameText.text = AbilitySystem.GetAbilityName(ab.id); abilityInfoDescriptionText.text = AbilitySystem.GetAbilityDescription(ab.powerType, (ab.power * ab.level)); abilityInfoNameText.enabled = true; abilityInfoDescriptionText.enabled = true; if (abilityInfoImage.GetComponentInParent <AiryUIAnimatedElement>() != null) { abilityInfoImage.GetComponentInParent <AiryUIAnimatedElement>().ShowElement(); } if (abilityTotalStatText != null) { AbilitySystem.SetAbilityStats(); abilityTotalStatText.text = AbilitySystem.GetAllAbilityStatToString(); } } }
protected void RotateToTargetPos(AbilitySystem Owner, Vector3 LookDir) { Transform trans = Owner.OwnerAgent.Animator.transform; trans.localRotation = Quaternion.LookRotation(LookDir, trans.up); trans.localRotation = Quaternion.Euler(0, trans.localRotation.eulerAngles.y, 0); }
public GameLogicManager() { m_LogicTickManager = new LogicTickManager(); m_LogicTickManager.AddTickable(new MovementSystem()); m_LogicTickManager.AddTickable(new CollideSystem()); m_LogicTickManager.AddTickable(new TrackingSystem()); m_LogicTickManager.AddTickable(new RecoverySystem()); var btSystem = new BehaviourTreeSystem(); m_LogicTickManager.AddTickable(btSystem); m_AbilitySystem = new AbilitySystem(); m_LogicTickManager.AddTickable(m_AbilitySystem); m_ModifierSystem = new ModifierSystem(); m_LogicTickManager.AddTickable(m_ModifierSystem); m_EntitySystem = new EntitySystem(); m_LogicTickManager.AddTickable(m_EntitySystem); Game.Instance.frameDataCollector.AddProvider(btSystem); m_EntityManager = new EntityManager(); }
private void OnTriggerEnter2D(Collider2D other) { if (canBreakTrough) { return; } if (other.tag != "Bullet" && other.tag != "searcher") { var isMeEnemy = owner.getCharacterSystem().isEnemy(); var otherCharacterSystem = other.gameObject.GetComponent <CharacterSystem>(); var isOtherEnemy = otherCharacterSystem && otherCharacterSystem.isEnemy(); if (isOtherEnemy && isMeEnemy) { return; } if (isOtherEnemy && owner.getCharacterSystem().CompareTag("Player")) { owner.getWeaponSystem().playShootAudio(); } AbilitySystem abilitySystem = other.gameObject.GetComponent <AbilitySystem>(); if (abilitySystem && weaponAbility) { var abilityInstance = Instantiate(weaponAbility); abilitySystem.addExternalEffect(abilityInstance); } Destroy(gameObject); } }
protected virtual void Start() { weaponSystem = GetComponent <WeaponSystem>(); characterSystem = GetComponent <CharacterSystem>(); abilitySystem = GetComponent <AbilitySystem>(); healthSystem = GetComponent <HealthSystem>(); }
public override void Initialize(LDBlock _data) { GridPos = (Vector2Int)Grid.WorldToCell(transform.position); transform.position = Grid.CellToWorld((Vector3Int)GridPos); Grid.setOccupied((Vector3Int)GridPos, true); Animator = GetComponentInChildren <Animator>(); AbilitySystem = new AbilitySystem(this); CharacterDataTemplate Data = CharacterDataTemplate.Load(); Data.GetMonsterStartingAttributes(Role) .ForEach(Entry => AbilitySystem.RegisterAttribute(Entry.Attribute, Entry.Value)); Data.GetMonsterAbilities(Role) .ForEach(Ability => AbilitySystem.GrantAbility(Ability)); Data.GetMonsterStartingEffects(Role) .ForEach(Effect => AbilitySystem.TryApplyEffectToSelf(Effect)); AbilitySystem.RegisterOnAttributeChanged(Attribute.Health, OnDamageTaken); CurrentHealth = AbilitySystem.GetAttributeValue(Attribute.Health).Value; AbilitySystem.RegisterOnAttributeChanged(Attribute.MaxHealth, UpdateMaxHealth); MaxHealth = AbilitySystem.GetAttributeValue(Attribute.MaxHealth).Value; AbilitySystem .GetGrantedAbilityTypes() .ForEach(Ability => { if (!Ability.Is(TypeTag.MoveAbility)) { MainAbility = Ability; } }); }
public void StoreAbility(AbilitySystem ability) { switch (ability._linkedButton) { // } }
public override void Initialize(LDBlock data) { bool found = false; LDCharacter OwningCharacter = new LDCharacter(); foreach (LDCharacter Character in data.characters) { if (Character.role == (byte)Role) { OwningCharacter = Character; found = true; } } if(!found) { DestroyImmediate(gameObject); return; } GridPos = (Vector2Int)GameStateManager.Instance.GetGridManager().WorldToCell(transform.position); transform.position = GameStateManager.Instance.GetGridManager().CellToWorld((Vector3Int)GridPos); GameStateManager.Instance.GetGridManager().setOccupied((Vector3Int)GridPos, true); Animator = GetComponentInChildren<Animator>(); AbilitySystem = new AbilitySystem(this); Name = OwningCharacter.name; Color = (CharacterColor)OwningCharacter.color; if (OwningCharacter.timeLine != null) { TimeLine = OwningCharacter.timeLine.ToList(); } else { TimeLine = new List<LDInputFrame>(); } CharacterDataTemplate Data = CharacterDataTemplate.Load(); if (OwningCharacter.attributes == null || OwningCharacter.attributes.Length == 0) { // NOTE: First time, Playing from start! Data.GetStartingAttributes(Role) .ForEach(Entry => AbilitySystem.RegisterAttribute(Entry.Attribute, Entry.Value)); } else { AbilitySystem.RegisterLDAttributes(OwningCharacter.attributes); } Data.GetAbilities(Role) .ForEach(Ability => AbilitySystem.GrantAbility(Ability)); Data.GetStartingEffects(Role) .ForEach(Effect => AbilitySystem.TryApplyEffectToSelf(Effect)); AbilitySystem.RegisterOnAttributeChanged(Attribute.Health, OnDamageTaken); CurrentHealth = AbilitySystem.GetAttributeValue(Attribute.Health).Value; AbilitySystem.RegisterOnAttributeChanged(Attribute.MaxHealth, UpdateMaxHealth); MaxHealth = AbilitySystem.GetAttributeValue(Attribute.MaxHealth).Value; }
public override void Activate(AbilitySystem Owner) { Commit(Owner); AbilitySystem Target = GetEnemyInTile(Owner, Owner.CurrentTarget); if (Ticker.ShouldVisualize) { if (Projectile != null) { CoroutineRunner.Instance.StartCoroutine(EffectVisualized(Owner, Target)); } else if (FromSelfToTargetParticleSystem != null) { CoroutineRunner.Instance.StartCoroutine(ApplyEffectVisualized(Owner, Target)); } else { ApplyEffectToTarget(Owner, Target); } } else if (Target != null) { ApplyEffectToTarget(Owner, Target); } }
public override bool IsTargetValid(AbilitySystem Owner) { Vector2Int TilePos = Owner.OwnerAgent.GridPos; Vector2Int TargetPos = Owner.CurrentTarget; return(Vector2Int.Distance(TilePos, TargetPos) <= Range); }
// Use this for initialization void Start() { anim = gameObject.GetComponent <Animator> (); abilitySystem = DontDestroyVars.varsObject.GetComponent <AbilitySystem> (); UpdateIcons(); canRotate = true; player = PlayerHealth.player; }
// TODO: add and Implement the backpack inventory. public Player() { levelSystem = new LevelSystem(); playerStats = new PlayerStats(); abilitySystem = new AbilitySystem(); quickInventory = new InventorySystem(4); equipeSystem = new EquipeSystem(); }
// Use this for initialization void Start() { attComp = (AttributeComponent)gameObject.GetComponent(typeof(AttributeComponent)); movement = (CharacterMovement)gameObject.GetComponent(typeof(CharacterMovement)); meleeSys = (MeleeSystem)gameObject.GetComponent(typeof(MeleeSystem)); rangedSys = (RangedSystem)GetComponent(typeof(RangedSystem)); abilitySys = (AbilitySystem)GetComponent(typeof(AbilitySystem)); }
void Awake() { hero = Instantiate(hero); healthSystem = gameObject.GetComponent <HealthSystem>(); skillSystem = gameObject.GetComponent <SkillSystem>(); buffSystem = gameObject.GetComponent <BuffSystem>(); abilitySystem = gameObject.GetComponent <AbilitySystem>(); //AddRequiredComponents(); }
public AbilityRuntime(AbilitySystem owner, AbilityConfig config) { this.owner = owner; this.assetName = config.name; this.Name = config.Name; values.minValue = 0; values.maxValue = 30; values.currentValue = Dice.Roll(3, 6); }
private void Start() { HeroSystem.LoadHero(); SkillSystem.LoadSkill(); AbilitySystem.LoadAbility(); ItemSystem.LoadItem(); MapSystem.LoadMap(); MissionSystem.LoadMission(); LocalizationManager.LoadLanguage(User.language); }
public static int GetHeroStatusCriticalPercent(ref HeroData data) { if (data.type == 0) { return((int)((data.intelligent * 0.05f) + (data.agility * 0.2f)) + AbilitySystem.GetAbilityStats(3) + ItemSystem.GetHeroEquipmentItemCritical(ref data)); } else { return((int)((data.intelligent * 0.05f) + (data.agility * 0.2f))); } }
public LDCharacter ToLDCharacter() { return new LDCharacter { name = Name, color = (byte)Color, role = (byte)Role, attributes = AbilitySystem.GetLDAttributes(), timeLine = TimeLine.ToArray(), }; }
public override void Tick(int CurrentFrame, bool Scrum) { AbilitySystem.IsScrumming = Scrum; TypeTag Action = Conversion.LDToGameplayTag(TimeLine[CurrentFrame].action); int X = GameStateManager.Instance.GetGridManager().xWidth; Vector2Int TargetPos = new Vector2Int(TimeLine[CurrentFrame].cell % X, TimeLine[CurrentFrame].cell / X); AbilitySystem.CurrentTarget = TargetPos; AbilitySystem.TryActivateAbilityByTag(Action); AbilitySystem.Tick(); AbilitySystem.IsScrumming = false; }
public static int GetHeroStatusMoveSpeed(ref HeroData data) { if (data.type == 0) { return(data.agility + 50 + AbilitySystem.GetAbilityStats(5) + ItemSystem.GetHeroEquipmentItemMoveSpeed(ref data)); } else { return(data.agility + 50); } }
public static int GetHeroStatusSkillEnergy(ref HeroData data) { if (data.type == 0) { return(data.intelligent + AbilitySystem.GetAbilityStats(6) + ItemSystem.GetHeroEquipmentItemSkillEnergy(ref data)); } else { return(data.intelligent); } }
public static int GetHeroStatusDefence(ref HeroData data) { if (data.type == 0) { return((data.physical * 5) + (data.agility) + AbilitySystem.GetAbilityStats(1) + ItemSystem.GetHeroEquipmentItemDefence(ref data) + LabSystem.GetAddDefence(User.addDefenceLevel)); } else { return((data.physical * 5) + (data.agility)); } }
public static int GetHeroStatusAttackSpeed(ref HeroData data) { if (data.type == 0) { return(data.strength + (data.agility * 5) + AbilitySystem.GetAbilityStats(4) + ItemSystem.GetHeroEquipmentItemAttackSpeed(ref data)); } else { return(data.strength + (data.agility * 5)); } }
public void PopupGetAbility(Ability ability) { if (PopGetAbilityUI != null) { PopGetAbilityUI.transform.GetChild(0).GetChild(0).GetComponent <Image>().sprite = Resources.Load <Sprite>(ability.image); PopGetAbilityUI.transform.GetChild(1).GetComponent <Text>().text = AbilitySystem.GetAbilityName(ability.id); showUIanimation(PopGetAbilityUI); } else { Debugging.Log("어빌리티 팝업창이 없습니다."); } }
public override bool IsTargetValid(AbilitySystem Owner) { Vector2Int TilePos = Owner.OwnerAgent.GridPos; Vector2Int TargetPos = Owner.CurrentTarget; if (Grid.IsOccupied((Vector3Int)TargetPos) || !Grid.GetCellStatus(TargetPos).HasFlag(GridGenerator.BlockStatus.Walkable)) { return(false); } Vector2Int Dist = (TargetPos - TilePos); return(Mathf.Abs(Dist.x) + Mathf.Abs(Dist.y) <= JumpDistance); }
public override bool IsTargetValid(AbilitySystem Owner) { Vector2Int TilePos = Owner.OwnerAgent.GridPos; Vector2Int TargetPos = Owner.CurrentTarget; if (!IsTileOccupiedByEnemy(Owner, TargetPos)) { return(false); } Vector2Int Dist = (TargetPos - TilePos); return(Mathf.Abs(Dist.x) + Mathf.Abs(Dist.y) == 1); }
public override void Tick(int _Frame, bool Scrum) { if (!IsAlive) { return; } (System.Type, Vector2Int)Action = SelectAction(); AbilitySystem.IsScrumming = Scrum; AbilitySystem.CurrentTarget = Action.Item2; AbilitySystem.TryActivateAbilityByTag(Action.Item1); AbilitySystem.Tick(); AbilitySystem.IsScrumming = false; }
public override void Activate(AbilitySystem Owner) { Commit(Owner); AbilitySystem Target = GetFriendlyInTile(Owner, Owner.CurrentTarget); if (Ticker.ShouldVisualize) { CoroutineRunner.Instance.StartCoroutine(PlayParticleSystemOnTarget(Owner, true)); } else if (Target == null) { ApplyEffectToTarget(Owner, Target); } }
public override bool IsTargetValid(AbilitySystem Owner) { Vector2Int TilePos = Owner.OwnerAgent.GridPos; Vector2Int TargetPos = Owner.CurrentTarget; //SelfTarget if (TilePos == TargetPos) { return(false); } //Is Cardinal if (TilePos.x != TargetPos.x && TilePos.y != TargetPos.y) { return(false); } //Can target enemy if (IsTileOccupiedByEnemy(Owner, TargetPos) && !CanTargetEnemy) { return(false); } //Can target friendly if (IsTileOccupiedByFriendly(Owner, TargetPos) && !CanTargetFriendy) { return(false); } //Blocked by obsticle Vector2Int direction = (TargetPos - TilePos); int targetRange = (int)Vector2Int.Distance(TilePos, TargetPos); if (direction.x != 0) { direction.x = (int)Mathf.Sign(direction.x); } if (direction.y != 0) { direction.y = (int)Mathf.Sign(direction.y); } if (FlagsAlongLine(TilePos, direction, targetRange, GridGenerator.BlockStatus.Obstacle) && CanBeBlockedByObstacle) { return(false); } //Is in range return(targetRange <= Range); }
public override bool IsTargetValid(AbilitySystem Owner) { if (Owner.OwnerAgent.GridPos == Owner.CurrentTarget) { return(false); } int MoveDistance = Owner.GetAttributeValue(Attribute.MovementDistance).Value; List <Vector3Int> Path = Grid.findPath((Vector3Int)Owner.OwnerAgent.GridPos, (Vector3Int)Owner.CurrentTarget); if (Path == null || Path.Count > MoveDistance) { return(false); } return(true); }
// Use this for initialization void Start() { ability = FindObjectOfType<AbilitySystem>(); armory = FindObjectOfType<ArmoryComponent>(); anim = GetComponent<Animator>(); animId_iStance = Animator.StringToHash("Stance"); anim_shotIsHit = false; primary = true; anim_shotIsHit = false; }
// Use this for initialization void Start() { GameObject managerObj = GameObject.Find("Manager"); manager = managerObj.GetComponent<ManagerSystem>(); dijSys = managerObj.GetComponent<DijkstraSystem>(); assist = managerObj.GetComponent<PlayerAssistanceSystem>(); abilSys = managerObj.GetComponent<AbilitySystem>(); selectedCell = selectedMovementCell = null; changedSelectedCell = changedSelectedMovementCell = false; rotationScript = (CameraRotationScript)FindObjectOfType (typeof(CameraRotationScript)); }
public void StoreAbility(AbilitySystem ability) { switch(ability._linkedButton){ // } }