Roman fcc2089ae4 任务:替换美术素材、填充剧情
1.替换和实装美术素材
(1.制作基督小怪闪电动画
(2.替换镰刀CD贴图
(3.重做贵族动画
(4.添加交互按键提示,包含catching物体时浮现Y键,以及被缠抱时浮现摇杆转动动画
(5.实装特洛伊木马的召唤炸弹攻击的动画
(6.实装玩家鬼魂动画

2.填充剧情
*.新的演出继承自进入式触发器,OnCall内编写演出内容
*.村的开幕演出中额外补上:根据当前玩家进度开关事件碰撞体的功能
制作演出:
(1.贵族之怒演出编写完毕
(2.农民之叹演出编写完毕
(3.爱欲之附演出编写完毕
(4.安拉之拉演出编写完毕
(5.以撒之童演出编写完毕
(6.那位大人演出编写完毕
*.修改村开幕演出逻辑,使开幕演出时根据进度显示和隐藏剧情的触发器
(7.修改地藏开场演出,让其开场先执行一次敲钟攻击,很帅
(8.修改伊斯兰前置关演出,加上神之对话
(9.修改以撒开幕演出,增加一小段展示段

*优化和修复
1.修复以撒大闪电多次判定的问题
2.修复只有佛教前置关有死亡记录显示的bug

*.修复运行测试发现问题:
1.佛教前置关开幕演出走出太多
2.佛教前置关开幕演出角色名字没有替换
3.佛教前置关遮挡关系异常
4.伊斯兰前置关开幕演出走出太多
5.伊斯兰前置关忘记安排小怪
6.伊斯兰前置关隔间演出触发器不够高
7.基督前置关对话UI人物太大
8.读取留言板UI存在问题,需要在每个场景分别解决
9.伊斯兰前置关转移块颜色未改透明
10.增加以撒生命值
11.最终对话错别字

*.至此,游戏除了音乐音效部分基本完成,还差一些美术素材
*.进入最后阶段,调试和看修改结果时,务必调用当前场景的OnCall,否则可能触发深不可测的Bug

*建议
1.给基督小怪的闪电添加shader
2.目前炸弹爆炸没有效果

下班
2021-12-28 00:35:00 +08:00

141 lines
4.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Sirenix.OdinInspector;
/// <summary>
/// 敌人的基类,包含一些基本的功能和事件的虚函数
/// </summary>
public class Enemy : MonoBehaviour
{
// _____ _ _ _
// | __ \ | | | (_)
// | |__) | _| |__ | |_ ___
// | ___/ | | | '_ \| | |/ __|
// | | | |_| | |_) | | | (__
// |_| \__,_|_.__/|_|_|\___|
/// <summary>
/// 生命值上限
/// </summary>
[FoldoutGroup("属性")][Header("生命值上限")]
public float HP;
/// <summary>
/// 攻击力
/// </summary>
[FoldoutGroup("属性")][Header("攻击力")]
public float ATK;
/// <summary>
/// 速度
/// </summary>
[FoldoutGroup("属性")][Header("移动速度")]
public float speed;
/// <summary>
/// 打死后掉多少金币
/// </summary>
[FoldoutGroup("属性")][Header("掉落金币数")]
public int coin;
/// <summary>
/// 怪物拥有的几种状态
/// </summary>
public enum State{wander,seek,atk,dead};
/// <summary>
/// 此时怪物能否被攻击
/// </summary>
[FoldoutGroup("状态")][Header("当前是否能被攻击")][ReadOnly]
public bool canBeHit = true;
/// <summary>
/// 当前状态
/// </summary>
[EnumPaging][SerializeField][Header("当前状态")][FoldoutGroup("状态")]
public State state;
// _____ _ _
// | __ \ (_) | |
// | |__) | __ ___ ____ _| |_ ___
// | ___/ '__| \ \ / / _` | __/ _ \
// | | | | | |\ V / (_| | || __/
// |_| |_| |_| \_/ \__,_|\__\___|
/// <summary>
/// 当前生命值
/// </summary>
[ReadOnly][SerializeField][ProgressBar(0,10,0.15f,0.47f,0.74f)][FoldoutGroup("状态")]
public float HPLeft;
// ______ _
// | ____| | |
// | |____ _____ _ __ | |_
// | __\ \ / / _ \ '_ \| __|
// | |___\ V / __/ | | | |_
// |______\_/ \___|_| |_|\__|
/// <summary>
/// 当怪物死的时候Call这个函数
/// </summary>
public virtual void OnDead(){}
/// <summary>
/// 当怪物触碰到玩家的时候Call这个
/// </summary>
protected virtual void OnTouchThePlayer(MyPlayer player){}
/// <summary>
/// 当怪物被打的时候触发
/// </summary>
/// <param name="hitMethod">攻击方式枚举类型具体看MyPlayer</param>
/// <param name="hitDir">受击方向,-1左1右</param>
public virtual void OnBeHit(MyPlayer.AtkMethod hitMethod,int hitDir){}
/// <summary>
/// 当怪物发现玩家的时候Call这个
/// </summary>
public virtual void OnFindThePlayer(Transform target){}
/// <summary>
/// 当怪物着地的时候触发一次
/// </summary>
public virtual void OnRetouchedTheGround(){}
// _ _ _
// | \ | | | |
// | \| | ___ _ __ _ __ ___ __ _| |
// | . ` |/ _ \| '__| '_ ` _ \ / _` | |
// | |\ | (_) | | | | | | | | (_| | |
// |_| \_|\___/|_| |_| |_| |_|\__,_|_|
/// <summary>
/// 看看死了没
/// </summary>
public bool CheckDead(){return !(HPLeft > 0);}
// _____ _ _ _ _
// / ____| | | (_) (_)
// | | ___ | | |_ ___ _ ___ _ __
// | | / _ \| | | / __| |/ _ \| '_ \
// | |___| (_) | | | \__ \ | (_) | | | |
// \_____\___/|_|_|_|___/_|\___/|_| |_|
protected void OnCollisionEnter2D(Collision2D other)//当有物体碰上
{
if(other.collider.gameObject.TryGetComponent<MyPlayer>(out MyPlayer player))
{OnTouchThePlayer(player);}//如果创到的是玩家则Call事件
//如果被镰刀创到Call一下OnBeHit事件传入攻击方式和攻击来袭方向
else if(other.collider.gameObject.TryGetComponent<Sickle>(out Sickle sickle))
{OnBeHit(MyPlayer.AtkMethod.,
(transform.position.x -
sickle.transform.position.x > 0) ? -1 : 1);
Destroy(sickle.gameObject);}
else if(other.gameObject.tag == "地面")
{OnRetouchedTheGround();}
}
protected virtual void OnTriggerEnter2D(Collider2D other)
{
if(other.gameObject.TryGetComponent<MyPlayer>(out MyPlayer player))
{OnFindThePlayer(other.transform);}//如果监视范围出现玩家则Call事件
}
}