Merge branch 'main' into art/ghostLady

This commit is contained in:
Craftelia 2025-07-27 16:35:27 -04:00
commit 6f2f4a2a3f
8 changed files with 1454 additions and 5 deletions

View File

@ -103,6 +103,8 @@ MonoBehaviour:
_speed: 0.15 _speed: 0.15
_attack_damage: 1 _attack_damage: 1
_attack_interval: 2 _attack_interval: 2
_enemy: {fileID: 0}
OpponentTraits: 00000000
--- !u!114 &5416582167583119277 --- !u!114 &5416582167583119277
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 07ebda7671039dc4b9a1d1b4eabb5aa9
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -73,7 +73,13 @@ public class Detection : MonoBehaviour
Entity otherEntity = other.gameObject.GetComponent<Entity>(); Entity otherEntity = other.gameObject.GetComponent<Entity>();
if (otherEntity == _entityLinked) if (otherEntity == _entityLinked)
{ {
_entityLinked.Hit(_projectileDamage); GhostOpponent isGhost = EntityLinked.gameObject.GetComponent<GhostOpponent>();
if (isGhost != null)
{
if(!isGhost.dodgedProjectile()) _entityLinked.Hit(_projectileDamage);
}
else _entityLinked.Hit(_projectileDamage);
// Kill if no hp // Kill if no hp
if (otherEntity.Hp <= 0) if (otherEntity.Hp <= 0)
{ {

View File

@ -1,5 +1,6 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEditorInternal;
using UnityEngine; using UnityEngine;
[CreateAssetMenu(menuName = project_name + "/Global Config")] [CreateAssetMenu(menuName = project_name + "/Global Config")]

View File

@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GhostOpponent : Opponent
{
[SerializeField]
//Le taux de chance, en pourcantage (un chiffre entre 0 et 99) que l'ennemie a d'eviter un projectile.
private int dodgePercent;
public bool dodgedProjectile()
{
System.Random random = new System.Random();
if(random.Next(0, 99) > dodgePercent) return false;
else return true;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9accc3bbf43ac664d99f80d0f5302897
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,5 +1,6 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEditorInternal;
using UnityEngine; using UnityEngine;
public class Opponent : Entity public class Opponent : Entity
@ -42,10 +43,6 @@ public class Opponent : Entity
Move(); Move();
} }
} }
void AttackEnemy() void AttackEnemy()