public void ShareClothes() { enkidu.EquipPart(SlotCategory.Skirt, skirt); enkidu.SetPartColor(SlotCategory.Skirt, ColorCode.Color1, skirtColor); shamhat.EquipPart(SlotCategory.Skirt, skirt); shamhat.SetPartColor(SlotCategory.Skirt, ColorCode.Color1, skirtColor); flowchart.ExecuteBlock("Thank You"); }
public void clothesGame() { gameObject.GetComponent <SpriteRenderer>().sprite = wearArea; clothes.SetActive(true); velocityY = -3f; clothesPos.y = clothes.transform.position.y; clothes.GetComponent <Rigidbody2D>().velocity = new Vector2(velocityX, velocityY); if (Input.GetKeyDown(KeyCode.Space) && drinkIsInside == true) { clothesCounter++; clothesPos.y = initialPosClothes; clothes.transform.position = clothesPos; if (clothesCounter == 1) { enkidu.EquipPart(SlotCategory.Armor, "Fantasy 01 Male"); enkidu.SetPartColor(SlotCategory.Armor, shirtColor1, shirtColor2, shirtColor2); clothes.GetComponent <SpriteRenderer>().sprite = pants; } else if (clothesCounter == 2) { flowchart.ExecuteBlock("Hurry"); enkidu.EquipPart(SlotCategory.Skirt, ""); enkidu.EquipPart(SlotCategory.Pants, "Fantasy 00 Male"); enkidu.SetPartColor(SlotCategory.Pants, ColorCode.Color1, pantsColor); clothes.GetComponent <SpriteRenderer>().sprite = shoes; } else if (clothesCounter == 3) { enkidu.EquipPart(SlotCategory.Boots, "Fantasy 00"); enkidu.SetPartColor(SlotCategory.Boots, ColorCode.Color1, bootsColor); } } else if (drinkIsInside == false && clothesPos.y < -1f) { clothesPos.y = initialPosClothes; clothes.transform.position = clothesPos; } }
private void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Meet Trigger") { flowchart.ExecuteBlock("Meet Dialogue"); } if (other.tag == "Axe") { Debug.Log("Its Triggering"); enkidu.EquipPart(SlotCategory.OffHand, "Axe 01"); enkidu.SetPartColor(SlotCategory.OffHand, weaponColor1, weaponColor2, weaponColor3); axe.SetActive(false); } }
public void EquipGoblet() { tableGoblet.SetActive(false); enkidu.EquipPart(SlotCategory.MainHand, "Goblet"); }
/// <summary> /// Randomize character's parts /// </summary> /// <param name="excludedCategory">(optional)Excluded SlotCategory</param> public void RandomizePart(params SlotCategory[] excludedCategory) { List <SlotCategory> excludedcats = new List <SlotCategory>(excludedCategory); // Get all available parts if null if (_availparts == null || _availparts.Count <= 0) { _availparts = new Dictionary <SlotCategory, List <Part> >(); foreach (SlotCategory c in System.Enum.GetValues(typeof(SlotCategory))) { _availparts.Add(c, PartList.Static.FindParts(c)); } } // Equip foreach (SlotCategory c in System.Enum.GetValues(typeof(SlotCategory))) { if (excludedcats.Contains(c)) { continue; } switch (c) { case SlotCategory.OffHand: Weapon w = character.GetAssignedPart(SlotCategory.MainHand) as Weapon; if (w == null) { character.EquipPart(c, nullpart); } else if (w.weaponCategory != WeaponCategory.TwoHanded && RollDice() < _RANDSETTINGS[c]) { character.EquipPart(c, _availparts[c][Random.Range(0, _availparts[c].Count)]); } break; case SlotCategory.Ear: if (RollDice() < _RANDSETTINGS[c]) { character.EquipPart(c, _availparts[c][Random.Range(0, _availparts[c].Count)]); } else { character.EquipPart(c, "00", "Base"); } break; case SlotCategory.Pants: int ppants = character.GetAssignedPart(SlotCategory.Skirt) != null ? 50 : 100; if (RollDice() < ppants) { character.EquipPart(c, _availparts[c][Random.Range(0, _availparts[c].Count)]); } else { character.EquipPart(c, "00", "Base"); } break; case SlotCategory.Skirt: int pskirt = character.bodyType == BodyType.Female ? 40 : 20; if (RollDice() < pskirt) { character.EquipPart(c, _availparts[c][Random.Range(0, _availparts[c].Count)]); character.EquipPart(SlotCategory.Pants, RollDice() < 50 ? _availparts[SlotCategory.Pants][Random.Range(0, _availparts[SlotCategory.Pants].Count)] : nullpart); } else { character.EquipPart(c, nullpart); character.EquipPart(SlotCategory.Pants, _availparts[SlotCategory.Pants][Random.Range(0, _availparts[SlotCategory.Pants].Count)]); } break; default: character.EquipPart(c, RollDice() < _RANDSETTINGS[c] ? _availparts[c][Random.Range(0, _availparts[c].Count)] : nullpart); break; } } }
/// <summary> /// Randomize character's part. /// </summary> public void RandomizePart(SlotCategory slotCategory) { if (_availparts == null || _availparts.Count <= 0) { _availparts = getAvailableParts(new List <string>()); } character.EquipPart(slotCategory, _availparts[slotCategory][Random.Range(0, _availparts[slotCategory].Count)]); }
public void RandomizePart() { // Get all available parts if null if (armors == null) { armors = PartList.Static.FindParts(SlotCategory.Armor); } if (pants == null) { pants = PartList.Static.FindParts(SlotCategory.Pants); } if (helmets == null) { helmets = PartList.Static.FindParts(SlotCategory.Helmet); } if (gloves == null) { gloves = PartList.Static.FindParts(SlotCategory.Gloves); } if (boots == null) { boots = PartList.Static.FindParts(SlotCategory.Boots); } if (capes == null) { capes = PartList.Static.FindParts(SlotCategory.Cape); } if (mainhand == null) { mainhand = PartList.Static.FindParts(SlotCategory.MainHand); } if (offhand == null) { offhand = PartList.Static.FindParts(SlotCategory.OffHand); } if (hair == null) { hair = PartList.Static.FindParts(SlotCategory.Hair); } if (fhair == null) { fhair = PartList.Static.FindParts(SlotCategory.FacialHair); } if (brow == null) { brow = PartList.Static.FindParts(SlotCategory.Eyebrow); } if (eyes == null) { eyes = PartList.Static.FindParts(SlotCategory.Eyes); } if (lips == null) { lips = PartList.Static.FindParts(SlotCategory.Mouth); } if (nose == null) { nose = PartList.Static.FindParts(SlotCategory.Nose); } if (ears == null) { ears = PartList.Static.FindParts(SlotCategory.Ear); } if (tatt == null) { tatt = PartList.Static.FindParts(SlotCategory.SkinDetails); } // Set body type & skin color if (RollDice() > 50) { character.SetBodyType(BodyType.Male); } else { character.SetBodyType(BodyType.Female); } // Equip armors character.EquipPart(SlotCategory.Armor, armors[Random.Range(0, armors.Count)]); character.EquipPart(SlotCategory.Pants, pants[Random.Range(0, pants.Count)]); if (RollDice() > 20) { character.EquipPart(SlotCategory.Helmet, helmets[Random.Range(0, helmets.Count)]); } else { character.EquipPart(SlotCategory.Helmet, nullpart); } if (RollDice() > 40) { character.EquipPart(SlotCategory.Gloves, gloves[Random.Range(0, gloves.Count)]); } else { character.EquipPart(SlotCategory.Gloves, nullpart); } character.EquipPart(SlotCategory.Boots, boots[Random.Range(0, boots.Count)]); if (RollDice() > 60) { character.EquipPart(SlotCategory.Cape, capes[Random.Range(0, capes.Count)]); } else { character.EquipPart(SlotCategory.Cape, nullpart); } // Equip weapons if (RollDice() > 50) { character.EquipPart(SlotCategory.MainHand, mainhand[Random.Range(0, mainhand.Count)]); Weapon w = character.GetAssignedPart(SlotCategory.MainHand) as Weapon; if (RollDice() > 50 && w.weaponCategory != WeaponCategory.TwoHanded) { character.EquipPart(SlotCategory.OffHand, offhand[Random.Range(0, offhand.Count)]); } } else { character.EquipPart(SlotCategory.MainHand, nullpart); character.EquipPart(SlotCategory.OffHand, nullpart); } // Equip facial feature if (RollDice() > 10) { character.EquipPart(SlotCategory.Hair, hair[Random.Range(0, hair.Count)]); } else { character.EquipPart(SlotCategory.Hair, nullpart); } if (RollDice() > 50) { character.EquipPart(SlotCategory.FacialHair, fhair[Random.Range(0, fhair.Count)]); } else { character.EquipPart(SlotCategory.FacialHair, nullpart); } if (RollDice() > 2) { character.EquipPart(SlotCategory.Eyebrow, brow[Random.Range(0, brow.Count)]); } else { character.EquipPart(SlotCategory.Eyebrow, nullpart); } if (RollDice() > 60) { character.EquipPart(SlotCategory.Ear, ears[Random.Range(0, ears.Count)]); } else { character.EquipPart(SlotCategory.Ear, "00", "Base"); } character.EquipPart(SlotCategory.Eyes, eyes[Random.Range(0, eyes.Count)]); character.EquipPart(SlotCategory.Mouth, lips[Random.Range(0, lips.Count)]); character.EquipPart(SlotCategory.Nose, nose[Random.Range(0, nose.Count)]); if (RollDice() > 60) { character.EquipPart(SlotCategory.SkinDetails, tatt[Random.Range(0, tatt.Count)]); } else { character.EquipPart(SlotCategory.SkinDetails, nullpart); } }