Skip to content
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.

Commit

Permalink
Jose Delgado character added
Browse files Browse the repository at this point in the history
  • Loading branch information
javierfoe committed Aug 23, 2019
1 parent f08ab0a commit 9f27d1b
Show file tree
Hide file tree
Showing 12 changed files with 381 additions and 253 deletions.
65 changes: 65 additions & 0 deletions Assets/Prefabs/Character/Jose Delgado.prefab
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &490826125789148606
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 490826125789148545}
- component: {fileID: 490826125789148544}
- component: {fileID: 490826125789148607}
m_Layer: 0
m_Name: Jose Delgado
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &490826125789148545
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 490826125789148606}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &490826125789148544
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 490826125789148606}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f37253140773b4148bf3983f442a400f, type: 3}
m_Name:
m_EditorClassIdentifier:
syncInterval: 0.1
characterName: Jose Delgado
characterHP: 4
--- !u!114 &490826125789148607
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 490826125789148606}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9b91ecbcc199f4492b9a91e820070131, type: 3}
m_Name:
m_EditorClassIdentifier:
serverOnly: 0
localPlayerAuthority: 0
m_AssetId: 0a862e7a025801c45ad8ce3e4b4d0989
m_SceneId: 0
7 changes: 7 additions & 0 deletions Assets/Prefabs/Character/Jose Delgado.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Assets/Scenes/MultiplayerLocal.unity
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ LightmapSettings:
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
Expand Down Expand Up @@ -181,6 +181,7 @@ MonoBehaviour:
- {fileID: 1384557101617452, guid: 0ad4a65027c4c194a94b3260bc270dbd, type: 3}
- {fileID: 1097694930350580, guid: e4a27e0db3f718b43b4ed9e8ef890cb2, type: 3}
- {fileID: 1110412893228910, guid: 386232d7bbf0cc4439cea08a7ab6b0c8, type: 3}
- {fileID: 490826125789148606, guid: 0a862e7a025801c45ad8ce3e4b4d0989, type: 3}
- {fileID: 1002505776817526, guid: 9cd9c079bd1285c4ba781ed771fae15f, type: 3}
- {fileID: 7915496552382078933, guid: aa7268b72eec4874e96bd686dc95013e, type: 3}
- {fileID: 5389608874815740603, guid: fc53ac13cda49da46a0ee5659408cdaa, type: 3}
Expand Down Expand Up @@ -386,7 +387,7 @@ MonoBehaviour:
m_GameObject: {fileID: 1202136533}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1077351063, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalAxis: Horizontal
Expand All @@ -405,7 +406,7 @@ MonoBehaviour:
m_GameObject: {fileID: 1202136533}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
Expand Down
157 changes: 79 additions & 78 deletions Assets/Scripts/Cards/Card.cs
Original file line number Diff line number Diff line change
@@ -1,79 +1,80 @@
using System.Collections;
using UnityEngine;
namespace PimPamPum
{
public abstract class Card
{
private static Color brownCard = Color.red;

public virtual Suit Suit => Struct.suit;

public virtual Rank Rank => Struct.rank;

public bool IsRed => Suit == Suit.Hearts || Suit == Suit.Diamonds;

public CardStruct Struct
{
get; protected set;
}

public virtual Card Original => null;

public virtual Color Color => brownCard;

public virtual bool Is<T>() where T : Card, new()
{
return this is T;
}

protected void SetSuitRank(Suit suit = Suit.Null, Rank rank = Rank.Null)
{
Struct = new CardStruct
{
suit = suit,
rank = rank,
name = ToString(),
color = Color
};
}

public virtual void BeginCardDrag(PlayerController pc)
{
pc.BeginCardDrag(this);
}

public virtual IEnumerator PlayCard(PlayerController pc, int player, Drop drop, int cardIndex)
{
yield return CardEvent(pc, player, drop, cardIndex);
yield return CardEffect(pc, player, drop, cardIndex);
yield return CardUsed(pc);
pc.FinishCardUsed();
}

protected virtual IEnumerator CardEffect(PlayerController pc, int player, Drop drop, int cardIndex)
{
pc.DiscardCardUsed();
yield return null;
}

protected virtual IEnumerator CardEvent(PlayerController pc, int player, Drop drop, int cardIndex)
{
yield return GameController.Instance.PimPamPumEventPlayedCard(pc.PlayerNumber, player, this, drop, cardIndex);
}

public abstract IEnumerator CardUsed(PlayerController pc);

public Card ConvertTo<T>() where T : Card, new()
{
Card converted = new T();
return new ConvertedCard(this, converted);
}

public static Card CreateNew<T>(Suit suit, Rank rank) where T : Card, new()
{
Card res = new T();
res.SetSuitRank(suit, rank);
return res;
}
}
using System.Collections;
using UnityEngine;

namespace PimPamPum
{
public abstract class Card
{
private static Color brownCard = Color.red;

public virtual Suit Suit => Struct.suit;

public virtual Rank Rank => Struct.rank;

public bool IsRed => Suit == Suit.Hearts || Suit == Suit.Diamonds;

public CardStruct Struct
{
get; protected set;
}

public virtual Card Original => null;

public virtual Color Color => brownCard;

public virtual bool Is<T>() where T : Card
{
return this is T;
}

protected void SetSuitRank(Suit suit = Suit.Null, Rank rank = Rank.Null)
{
Struct = new CardStruct
{
suit = suit,
rank = rank,
name = ToString(),
color = Color
};
}

public virtual void BeginCardDrag(PlayerController pc)
{
pc.BeginCardDrag(this);
}

public virtual IEnumerator PlayCard(PlayerController pc, int player, Drop drop, int cardIndex)
{
yield return CardEvent(pc, player, drop, cardIndex);
yield return CardEffect(pc, player, drop, cardIndex);
yield return CardUsed(pc);
pc.FinishCardUsed();
}

protected virtual IEnumerator CardEffect(PlayerController pc, int player, Drop drop, int cardIndex)
{
pc.DiscardCardUsed();
yield return null;
}

protected virtual IEnumerator CardEvent(PlayerController pc, int player, Drop drop, int cardIndex)
{
yield return GameController.Instance.PimPamPumEventPlayedCard(pc.PlayerNumber, player, this, drop, cardIndex);
}

public abstract IEnumerator CardUsed(PlayerController pc);

public Card ConvertTo<T>() where T : Card, new()
{
Card converted = new T();
return new ConvertedCard(this, converted);
}

public static Card CreateNew<T>(Suit suit, Rank rank) where T : Card, new()
{
Card res = new T();
res.SetSuitRank(suit, rank);
return res;
}
}
}
41 changes: 21 additions & 20 deletions Assets/Scripts/Cards/Missed.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
using System.Collections;
namespace PimPamPum
{
public class Missed : Card
{
protected override IEnumerator CardEffect(PlayerController pc, int player, Drop drop, int cardIndex)
{
yield return null;
}

public override IEnumerator CardUsed(PlayerController pc)
{
yield return GameController.Instance.UsedCard<Missed>(pc);
}

public override string ToString()
{
return "Missed";
}
}
using System.Collections;

namespace PimPamPum
{
public class Missed : Card
{
protected override IEnumerator CardEffect(PlayerController pc, int player, Drop drop, int cardIndex)
{
yield return null;
}

public override IEnumerator CardUsed(PlayerController pc)
{
yield return GameController.Instance.UsedCard<Missed>(pc);
}

public override string ToString()
{
return "Missed";
}
}
}
83 changes: 42 additions & 41 deletions Assets/Scripts/Cards/Properties/Barrel.cs
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
using System.Collections;
namespace PimPamPum
{
public class Barrel : Property, ICondition
{
public override void BeginCardDrag(PlayerController pc)
{
base.BeginCardDrag(pc);
pc.SelfTargetPropertyCard<Barrel>();
}

public override void AddPropertyEffect(PlayerController pc)
{
pc.EquipBarrel();
}

public override void RemovePropertyEffect(PlayerController pc)
{
pc.UnequipBarrel();
}

public bool CheckCondition(Card c)
{
return c.Suit == Suit.Hearts;
}

protected override IEnumerator EquipTrigger(PlayerController pc)
{
yield return pc.Equip<Barrel>(this);
}

public override IEnumerator CardUsed(PlayerController pc)
{
yield return GameController.Instance.UsedCard<Barrel>(pc);
}

public override string ToString()
{
return "Barrel";
}
}
using System.Collections;

namespace PimPamPum
{
public class Barrel : Property, ICondition
{
public override void BeginCardDrag(PlayerController pc)
{
base.BeginCardDrag(pc);
pc.SelfTargetPropertyCard<Barrel>();
}

public override void AddPropertyEffect(PlayerController pc)
{
pc.EquipBarrel();
}

public override void RemovePropertyEffect(PlayerController pc)
{
pc.UnequipBarrel();
}

public bool CheckCondition(Card c)
{
return c.Suit == Suit.Hearts;
}

protected override IEnumerator EquipTrigger(PlayerController pc)
{
yield return pc.Equip<Barrel>(this);
}

public override IEnumerator CardUsed(PlayerController pc)
{
yield return GameController.Instance.UsedCard<Barrel>(pc);
}

public override string ToString()
{
return "Barrel";
}
}
}
Loading

0 comments on commit 9f27d1b

Please sign in to comment.