Skip to content

Commit

Permalink
using db data
Browse files Browse the repository at this point in the history
  • Loading branch information
salt26 committed Jul 16, 2023
1 parent d9b29b5 commit e7aff64
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 281 deletions.
2 changes: 2 additions & 0 deletions Assets/Scenes/Boss_Thor.unity
Original file line number Diff line number Diff line change
Expand Up @@ -1878,6 +1878,8 @@ MonoBehaviour:
player: {fileID: 2067595991}
mjolnir: {fileID: 372160546}
stonePrefab: {fileID: 5836515370467644410, guid: 7de4a12156948944d9b22fe9b4d0e158, type: 3}
thor1Sprite: {fileID: 1265616939, guid: 880fa571a0366cd4c977fb921f2e110a, type: 3}
thor2Sprite: {fileID: -349866061, guid: 880fa571a0366cd4c977fb921f2e110a, type: 3}
mjolnirSpeed: 30
--- !u!1 &358374606
GameObject:
Expand Down
267 changes: 0 additions & 267 deletions Assets/Scenes/SampleScene.unity

This file was deleted.

7 changes: 0 additions & 7 deletions Assets/Scenes/SampleScene.unity.meta

This file was deleted.

15 changes: 11 additions & 4 deletions Assets/Scripts/Boss/Boss.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using UnityEditor.Experimental.GraphView;
using UnityEngine;
using UnityEngine.UI;
using static UnityEngine.UI.Image;
Expand Down Expand Up @@ -31,10 +32,16 @@ public class Boss : MonoBehaviour

protected delegate void Pattern();
protected Pattern pattern;

public void GetDamaged(int attackBookLevel)
public void GetDamaged()
{
nowHP -= normalDamage + attackBookLevel*2; //TODO

int historyLevel = BookManager.Instance.CheckBookEquipped("Challenge");

float effect1 = float.Parse(BookManager.Instance.bookDB.GetData().Find(
e => e[BookManager.Instance.bookDB.GetHeaderIndex("title")].Equals("Challenge") &&
int.Parse(e[BookManager.Instance.bookDB.GetHeaderIndex("level")]) == historyLevel)[BookManager.Instance.bookDB.GetHeaderIndex("effect1")]);

nowHP -= normalDamage * effect1 / 100f;
BookManager.Instance.AddBlood(10);
hpSlider.value = nowHP/maxHP;
GameManager.Instance.QuestManager.CheckAttackPercent();
Expand Down Expand Up @@ -109,7 +116,7 @@ private void OnTriggerEnter2D(Collider2D col)
{
if(col.gameObject.tag == "Slash")
{
GetDamaged(BookManager.Instance.CheckBookEquipped("Challenge"));
GetDamaged();
}
}
}
Loading

0 comments on commit e7aff64

Please sign in to comment.