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

206 lines
7.4 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 YiSiLan : Enemy, Boomer.I_CanBeBoomedObj
{
// _____ _ _ _
// | __ \ | | | (_)
// | |__) | _| |__ | |_ ___
// | ___/ | | | '_ \| | |/ __|
// | | | |_| | |_) | | | (__
// |_| \__,_|_.__/|_|_|\___|
[FoldoutGroup("其他",false,0)][Header("怪物死后旋转速度的随机区间")]
public float deadRotationRangeMax;
[FoldoutGroup("其他",false,0)]
public float deadRotationRangeMin;
/// <summary>
/// 抓到玩家后多长事件触发爆炸
/// </summary>
[Header("抓到玩家后多长事件触发爆炸")][FoldoutGroup("伊斯兰")]
public float boomTime;
/// <summary>
/// 被击飞力度的调整值
/// </summary>
[Header("被攻击后击飞的力度调整值")][FoldoutGroup("其他",false,0)]
public Vector2 hitToflyParameter;
// _____ _ _
// | __ \ (_) | |
// | |__) | __ ___ ____ _| |_ ___
// | ___/ '__| \ \ / / _` | __/ _ \
// | | | | | |\ V / (_| | || __/
// |_| |_| |_| \_/ \__,_|\__\___|
private Rigidbody2D m_rigidbody;
/// <summary>
/// seek函数中的追踪目标
/// </summary>
public Transform target;
/// <summary>
/// 记录此时玩家是否在爆炸范围内
/// </summary>
[Header("记录此时玩家是否在爆炸范围内")][SerializeField][FoldoutGroup("伊斯兰")][ReadOnly]
private bool canHitPlayer;
public Animator animator;
/// <summary>
/// 这个小怪特殊吗?特殊的是剧情用的
/// </summary>
public bool isThisSpecial = false;
// _____ _ _ ____ _
// / ____| | | | _ \ | |
// | | __ _| | | |_) | __ _ ___| | __
// | | / _` | | | _ < / _` |/ __| |/ /
// | |___| (_| | | | |_) | (_| | (__| <
// \_____\__,_|_|_|____/ \__,_|\___|_|\_\
void Start(){Init();}//初始化
void FixedUpdate(){if(state == State.seek)Seek();}//seek
// _ _ _
// | \ | | | |
// | \| | ___ _ __ _ __ ___ __ _| |
// | . ` |/ _ \| '__| '_ ` _ \ / _` | |
// | |\ | (_) | | | | | | | | (_| | |
// |_| \_|\___/|_| |_| |_| |_|\__,_|_|
private void Init(){
//初始化状态为Seek
if(!isThisSpecial)state = State.seek;
//找到必要的组件
m_rigidbody = GetComponent<Rigidbody2D>();
target = FindObjectOfType<MyPlayer>().transform;
animator = GetComponent<Animator>();
if(!isThisSpecial) animator.SetBool("isMove",true);
}
/// <summary>
/// 寻找函数每Fixed调用
/// </summary>
private void Seek(){
//构造一个方向1代表向右-1代表向左
int dir = (target.position.x - transform.position.x > 0) ? 1:-1;
//使刚体水平方向上获得速度
m_rigidbody.velocity = new Vector2(speed * dir,
m_rigidbody.velocity.y);
//矫正一下faceDir的问题,使其始终朝向玩家
transform.rotation = Quaternion.
Euler
(transform.rotation.x,
((dir == 1) ? 0:-180),
transform.rotation.z);
}
/// <summary>
/// 碰到玩家的时候触发,伊斯兰爆炸的时候Call这个通过协程触发因为爆炸有个延时
/// </summary>
private void Boom(){
//
deadRotationRangeMax *= 3;
deadRotationRangeMin *= 3;
hitToflyParameter *= 3;
state = State.dead;
OnBeHit(MyPlayer.AtkMethod.,(target.position.x - transform.position.x > 0) ? 1:-1);
// //让自己去世
// OnDead();
//判定能否攻击到玩家
if(canHitPlayer){
FindObjectOfType<MyPlayer>().OnBeHit(ATK,(target.position.x - transform.position.x > 0) ? -1:1);
// //加一个扭矩,营造死亡的效果
// m_rigidbody.AddTorque(Random.Range(deadRotationRangeMin,deadRotationRangeMax) *
// ((target.position.x - transform.position.x > 0) ? -1:1));
}
}
/// <summary>
/// 被击飞的击飞效果处理
/// </summary>
/// <param name="dir">被击方向</param>
public void BeHitToFly(int dir){
m_rigidbody.velocity += new Vector2( //给予自身一个
-1 * dir * hitToflyParameter.x,//X方向为力度系数乘以受击方向
hitToflyParameter.y//Y方向为力度系数
//的绝对的速度
);
}
/// <summary>
/// 协程用,删除自己这个游戏物体
/// </summary>
protected void Dead(){Destroy(gameObject);}
// ______ _
// | ____| | |
// | |____ _____ _ __ | |_
// | __\ \ / / _ \ '_ \| __|
// | |___\ V / __/ | | | |_
// |______\_/ \___|_| |_|\__|
protected override void OnTouchThePlayer(MyPlayer player){
Invoke("Boom",boomTime);
//播放爆炸动画
animator.SetBool("isBoom",true);
}
public override void OnDead(){
//标记当前状态为死亡
state = State.dead;
//加一个扭矩,营造死亡的效果
m_rigidbody.AddTorque(Random.Range(deadRotationRangeMin,deadRotationRangeMax) *
((target.position.x - transform.position.x > 0) ? -1 : 1));
//关掉自己的碰撞体
GetComponent<BoxCollider2D>().enabled = false;
//两秒后自己毁灭
Invoke("Dead",2f);
}
public override void OnBeHit(MyPlayer.AtkMethod hitMethod, int hitDir){
//让自己被击飞
BeHitToFly(hitDir);
//结算生命值
HPLeft -= MyPlayer.atkMethodMagnification[hitMethod];
//看下死了没
//死了就记录下死亡时候的面部朝向用来做死亡翻滚效果然后再Call一下死亡事件
if(CheckDead()) {OnDead();}
//被打飞了在着地前都不会挨打了
canBeHit = false;
}
// _____ _ _ _ _
// / ____| | | (_) (_)
// | | ___ | | |_ ___ _ ___ _ __
// | | / _ \| | | / __| |/ _ \| '_ \
// | |___| (_) | | | \__ \ | (_) | | | |
// \_____\___/|_|_|_|___/_|\___/|_| |_|
//触发器代表炸弹范围,进入说明能炸到,离开说明炸不到了
protected override void OnTriggerEnter2D(Collider2D other){
base.OnTriggerEnter2D(other);
if(other.gameObject.TryGetComponent<MyPlayer>(out MyPlayer player))
canHitPlayer = true;
}
void OnTriggerExit2D(Collider2D other){
if(other.gameObject.TryGetComponent<MyPlayer>(out MyPlayer player))
canHitPlayer = false;
}
// _____ _ __
// |_ _| | | / _|
// | | _ __ | |_ ___ _ __| |_ __ _ ___ ___
// | | | '_ \| __/ _ \ '__| _/ _` |/ __/ _ \
// _| |_| | | | || __/ | | || (_| | (_| __/
// |_____|_| |_|\__\___|_| |_| \__,_|\___\___|
public void BeBoomed(float atk, int dir, Boomer boomer){
//需要重写
OnBeHit(MyPlayer.AtkMethod.,dir);
}
public Transform ObjTransform(){return transform;}
}